Win32 API 日本語リファレンス
ホームGraphics.Printing › MONITORREG

MONITORREG

構造体
サイズx64: 88 バイト / x86: 44 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
cbSizeDWORD4+0+0この構造体のサイズをバイト単位で指定する。
fpCreateKeyINT_PTR8/4+8+4レジストリキー作成を実装する関数へのポインター。
fpOpenKeyINT_PTR8/4+16+8レジストリキーを開く関数へのポインター。
fpCloseKeyINT_PTR8/4+24+12レジストリキーを閉じる関数へのポインター。
fpDeleteKeyINT_PTR8/4+32+16レジストリキー削除を実装する関数へのポインター。
fpEnumKeyINT_PTR8/4+40+20レジストリサブキー列挙を実装する関数へのポインター。
fpQueryInfoKeyINT_PTR8/4+48+24レジストリキー情報照会を実装する関数へのポインター。
fpSetValueINT_PTR8/4+56+28レジストリ値設定を実装する関数へのポインター。
fpDeleteValueINT_PTR8/4+64+32レジストリ値削除を実装する関数へのポインター。
fpEnumValueINT_PTR8/4+72+36レジストリ値列挙を実装する関数へのポインター。
fpQueryValueINT_PTR8/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 Structure
import 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: int
struct 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