ホーム › Graphics.Printing › MONITORREG
MONITORREG
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | この構造体のサイズをバイト単位で指定する。 |
| fpCreateKey | INT_PTR | 8/4 | +8 | +4 | レジストリキー作成を実装する関数へのポインター。 |
| fpOpenKey | INT_PTR | 8/4 | +16 | +8 | レジストリキーを開く関数へのポインター。 |
| fpCloseKey | INT_PTR | 8/4 | +24 | +12 | レジストリキーを閉じる関数へのポインター。 |
| fpDeleteKey | INT_PTR | 8/4 | +32 | +16 | レジストリキー削除を実装する関数へのポインター。 |
| fpEnumKey | INT_PTR | 8/4 | +40 | +20 | レジストリサブキー列挙を実装する関数へのポインター。 |
| fpQueryInfoKey | INT_PTR | 8/4 | +48 | +24 | レジストリキー情報照会を実装する関数へのポインター。 |
| fpSetValue | INT_PTR | 8/4 | +56 | +28 | レジストリ値設定を実装する関数へのポインター。 |
| fpDeleteValue | INT_PTR | 8/4 | +64 | +32 | レジストリ値削除を実装する関数へのポインター。 |
| fpEnumValue | INT_PTR | 8/4 | +72 | +36 | レジストリ値列挙を実装する関数へのポインター。 |
| fpQueryValue | INT_PTR | 8/4 | +80 | +40 | レジストリ値照会を実装する関数へのポインター。 |
各言語での定義
#include <windows.h>
// MONITORREG (x64 88 / x86 44 バイト)
typedef struct MONITORREG {
DWORD cbSize;
INT_PTR fpCreateKey;
INT_PTR fpOpenKey;
INT_PTR fpCloseKey;
INT_PTR fpDeleteKey;
INT_PTR fpEnumKey;
INT_PTR fpQueryInfoKey;
INT_PTR fpSetValue;
INT_PTR fpDeleteValue;
INT_PTR fpEnumValue;
INT_PTR fpQueryValue;
} MONITORREG;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MONITORREG
{
public uint cbSize;
public IntPtr fpCreateKey;
public IntPtr fpOpenKey;
public IntPtr fpCloseKey;
public IntPtr fpDeleteKey;
public IntPtr fpEnumKey;
public IntPtr fpQueryInfoKey;
public IntPtr fpSetValue;
public IntPtr fpDeleteValue;
public IntPtr fpEnumValue;
public IntPtr fpQueryValue;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MONITORREG
Public cbSize As UInteger
Public fpCreateKey As IntPtr
Public fpOpenKey As IntPtr
Public fpCloseKey As IntPtr
Public fpDeleteKey As IntPtr
Public fpEnumKey As IntPtr
Public fpQueryInfoKey As IntPtr
Public fpSetValue As IntPtr
Public fpDeleteValue As IntPtr
Public fpEnumValue As IntPtr
Public fpQueryValue As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class MONITORREG(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("fpCreateKey", ctypes.c_ssize_t),
("fpOpenKey", ctypes.c_ssize_t),
("fpCloseKey", ctypes.c_ssize_t),
("fpDeleteKey", ctypes.c_ssize_t),
("fpEnumKey", ctypes.c_ssize_t),
("fpQueryInfoKey", ctypes.c_ssize_t),
("fpSetValue", ctypes.c_ssize_t),
("fpDeleteValue", ctypes.c_ssize_t),
("fpEnumValue", ctypes.c_ssize_t),
("fpQueryValue", ctypes.c_ssize_t),
]#[repr(C)]
pub struct MONITORREG {
pub cbSize: u32,
pub fpCreateKey: isize,
pub fpOpenKey: isize,
pub fpCloseKey: isize,
pub fpDeleteKey: isize,
pub fpEnumKey: isize,
pub fpQueryInfoKey: isize,
pub fpSetValue: isize,
pub fpDeleteValue: isize,
pub fpEnumValue: isize,
pub fpQueryValue: isize,
}import "golang.org/x/sys/windows"
type MONITORREG struct {
cbSize uint32
fpCreateKey uintptr
fpOpenKey uintptr
fpCloseKey uintptr
fpDeleteKey uintptr
fpEnumKey uintptr
fpQueryInfoKey uintptr
fpSetValue uintptr
fpDeleteValue uintptr
fpEnumValue uintptr
fpQueryValue uintptr
}type
MONITORREG = record
cbSize: DWORD;
fpCreateKey: NativeInt;
fpOpenKey: NativeInt;
fpCloseKey: NativeInt;
fpDeleteKey: NativeInt;
fpEnumKey: NativeInt;
fpQueryInfoKey: NativeInt;
fpSetValue: NativeInt;
fpDeleteValue: NativeInt;
fpEnumValue: NativeInt;
fpQueryValue: NativeInt;
end;const MONITORREG = extern struct {
cbSize: u32,
fpCreateKey: isize,
fpOpenKey: isize,
fpCloseKey: isize,
fpDeleteKey: isize,
fpEnumKey: isize,
fpQueryInfoKey: isize,
fpSetValue: isize,
fpDeleteValue: isize,
fpEnumValue: isize,
fpQueryValue: isize,
};type
MONITORREG {.bycopy.} = object
cbSize: uint32
fpCreateKey: int
fpOpenKey: int
fpCloseKey: int
fpDeleteKey: int
fpEnumKey: int
fpQueryInfoKey: int
fpSetValue: int
fpDeleteValue: int
fpEnumValue: int
fpQueryValue: intstruct MONITORREG
{
uint cbSize;
ptrdiff_t fpCreateKey;
ptrdiff_t fpOpenKey;
ptrdiff_t fpCloseKey;
ptrdiff_t fpDeleteKey;
ptrdiff_t fpEnumKey;
ptrdiff_t fpQueryInfoKey;
ptrdiff_t fpSetValue;
ptrdiff_t fpDeleteValue;
ptrdiff_t fpEnumValue;
ptrdiff_t fpQueryValue;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; MONITORREG サイズ: 44 バイト(x86)
dim st, 11 ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; fpCreateKey : INT_PTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; fpOpenKey : INT_PTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; fpCloseKey : INT_PTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; fpDeleteKey : INT_PTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; fpEnumKey : INT_PTR (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; fpQueryInfoKey : INT_PTR (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; fpSetValue : INT_PTR (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; fpDeleteValue : INT_PTR (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; fpEnumValue : INT_PTR (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; fpQueryValue : INT_PTR (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MONITORREG サイズ: 88 バイト(x64)
dim st, 22 ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; fpCreateKey : INT_PTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; fpOpenKey : INT_PTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; fpCloseKey : INT_PTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; fpDeleteKey : INT_PTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; fpEnumKey : INT_PTR (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; fpQueryInfoKey : INT_PTR (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; fpSetValue : INT_PTR (+56, 8byte) qpoke st,56,値 / qpeek(st,56) ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; fpDeleteValue : INT_PTR (+64, 8byte) qpoke st,64,値 / qpeek(st,64) ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; fpEnumValue : INT_PTR (+72, 8byte) qpoke st,72,値 / qpeek(st,72) ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; fpQueryValue : INT_PTR (+80, 8byte) qpoke st,80,値 / qpeek(st,80) ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MONITORREG
#field int cbSize
#field intptr fpCreateKey
#field intptr fpOpenKey
#field intptr fpCloseKey
#field intptr fpDeleteKey
#field intptr fpEnumKey
#field intptr fpQueryInfoKey
#field intptr fpSetValue
#field intptr fpDeleteValue
#field intptr fpEnumValue
#field intptr fpQueryValue
#endstruct
stdim st, MONITORREG ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize