ホーム › Graphics.Printing › COMPROPSHEETUI
COMPROPSHEETUI
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | WORD | 2 | +0 | +0 | 本構造体のサイズ(バイト単位)。 |
| Flags | WORD | 2 | +2 | +2 | 共通プロパティシートUIの動作を制御するビットフラグ。 |
| hInstCaller | HINSTANCE | 8/4 | +8 | +4 | 呼び出し元モジュールのインスタンスハンドル。 |
| pCallerName | CHAR* | 8/4 | +16 | +8 | 呼び出し元の名称文字列へのポインタ。 |
| UserData | UINT_PTR | 8/4 | +24 | +12 | アプリケーション定義のユーザーデータ。 |
| pHelpFile | CHAR* | 8/4 | +32 | +16 | ヘルプファイルのパスへのポインタ。NULL可。 |
| pfnCallBack | _CPSUICALLBACK | 8/4 | +40 | +20 | オプション項目変更時に呼ばれるコールバック関数へのポインタ。 |
| pOptItem | OPTITEM* | 8/4 | +48 | +24 | オプション項目配列(OPTITEM)の先頭へのポインタ。 |
| pDlgPage | DLGPAGE* | 8/4 | +56 | +28 | ダイアログページ配列(DLGPAGE)の先頭へのポインタ。 |
| cOptItem | WORD | 2 | +64 | +32 | pOptItem配列の項目数。 |
| cDlgPage | WORD | 2 | +66 | +34 | pDlgPage配列のページ数。 |
| IconID | UINT_PTR | 8/4 | +72 | +36 | シートに表示するアイコンのリソースID。 |
| pOptItemName | CHAR* | 8/4 | +80 | +40 | オプション項目グループの名称文字列へのポインタ。 |
| CallerVersion | WORD | 2 | +88 | +44 | 呼び出し元のバージョン番号。 |
| OptItemVersion | WORD | 2 | +90 | +46 | オプション項目構造体のバージョン番号。 |
| dwReserved | UINT_PTR | 32/16 | +96 | +48 | 予約フィールド。0を設定する。 |
各言語での定義
#include <windows.h>
// COMPROPSHEETUI (x64 128 / x86 64 バイト)
typedef struct COMPROPSHEETUI {
WORD cbSize;
WORD Flags;
HINSTANCE hInstCaller;
CHAR* pCallerName;
UINT_PTR UserData;
CHAR* pHelpFile;
_CPSUICALLBACK pfnCallBack;
OPTITEM* pOptItem;
DLGPAGE* pDlgPage;
WORD cOptItem;
WORD cDlgPage;
UINT_PTR IconID;
CHAR* pOptItemName;
WORD CallerVersion;
WORD OptItemVersion;
UINT_PTR dwReserved[4];
} COMPROPSHEETUI;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct COMPROPSHEETUI
{
public ushort cbSize;
public ushort Flags;
public IntPtr hInstCaller;
public IntPtr pCallerName;
public UIntPtr UserData;
public IntPtr pHelpFile;
public IntPtr pfnCallBack;
public IntPtr pOptItem;
public IntPtr pDlgPage;
public ushort cOptItem;
public ushort cDlgPage;
public UIntPtr IconID;
public IntPtr pOptItemName;
public ushort CallerVersion;
public ushort OptItemVersion;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public UIntPtr[] dwReserved;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure COMPROPSHEETUI
Public cbSize As UShort
Public Flags As UShort
Public hInstCaller As IntPtr
Public pCallerName As IntPtr
Public UserData As UIntPtr
Public pHelpFile As IntPtr
Public pfnCallBack As IntPtr
Public pOptItem As IntPtr
Public pDlgPage As IntPtr
Public cOptItem As UShort
Public cDlgPage As UShort
Public IconID As UIntPtr
Public pOptItemName As IntPtr
Public CallerVersion As UShort
Public OptItemVersion As UShort
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=4)> Public dwReserved() As UIntPtr
End Structureimport ctypes
from ctypes import wintypes
class COMPROPSHEETUI(ctypes.Structure):
_fields_ = [
("cbSize", ctypes.c_ushort),
("Flags", ctypes.c_ushort),
("hInstCaller", ctypes.c_void_p),
("pCallerName", ctypes.c_void_p),
("UserData", ctypes.c_size_t),
("pHelpFile", ctypes.c_void_p),
("pfnCallBack", ctypes.c_void_p),
("pOptItem", ctypes.c_void_p),
("pDlgPage", ctypes.c_void_p),
("cOptItem", ctypes.c_ushort),
("cDlgPage", ctypes.c_ushort),
("IconID", ctypes.c_size_t),
("pOptItemName", ctypes.c_void_p),
("CallerVersion", ctypes.c_ushort),
("OptItemVersion", ctypes.c_ushort),
("dwReserved", ctypes.c_size_t * 4),
]#[repr(C)]
pub struct COMPROPSHEETUI {
pub cbSize: u16,
pub Flags: u16,
pub hInstCaller: *mut core::ffi::c_void,
pub pCallerName: *mut core::ffi::c_void,
pub UserData: usize,
pub pHelpFile: *mut core::ffi::c_void,
pub pfnCallBack: *mut core::ffi::c_void,
pub pOptItem: *mut core::ffi::c_void,
pub pDlgPage: *mut core::ffi::c_void,
pub cOptItem: u16,
pub cDlgPage: u16,
pub IconID: usize,
pub pOptItemName: *mut core::ffi::c_void,
pub CallerVersion: u16,
pub OptItemVersion: u16,
pub dwReserved: [usize; 4],
}import "golang.org/x/sys/windows"
type COMPROPSHEETUI struct {
cbSize uint16
Flags uint16
hInstCaller uintptr
pCallerName uintptr
UserData uintptr
pHelpFile uintptr
pfnCallBack uintptr
pOptItem uintptr
pDlgPage uintptr
cOptItem uint16
cDlgPage uint16
IconID uintptr
pOptItemName uintptr
CallerVersion uint16
OptItemVersion uint16
dwReserved [4]uintptr
}type
COMPROPSHEETUI = record
cbSize: Word;
Flags: Word;
hInstCaller: Pointer;
pCallerName: Pointer;
UserData: NativeUInt;
pHelpFile: Pointer;
pfnCallBack: Pointer;
pOptItem: Pointer;
pDlgPage: Pointer;
cOptItem: Word;
cDlgPage: Word;
IconID: NativeUInt;
pOptItemName: Pointer;
CallerVersion: Word;
OptItemVersion: Word;
dwReserved: array[0..3] of NativeUInt;
end;const COMPROPSHEETUI = extern struct {
cbSize: u16,
Flags: u16,
hInstCaller: ?*anyopaque,
pCallerName: ?*anyopaque,
UserData: usize,
pHelpFile: ?*anyopaque,
pfnCallBack: ?*anyopaque,
pOptItem: ?*anyopaque,
pDlgPage: ?*anyopaque,
cOptItem: u16,
cDlgPage: u16,
IconID: usize,
pOptItemName: ?*anyopaque,
CallerVersion: u16,
OptItemVersion: u16,
dwReserved: [4]usize,
};type
COMPROPSHEETUI {.bycopy.} = object
cbSize: uint16
Flags: uint16
hInstCaller: pointer
pCallerName: pointer
UserData: uint
pHelpFile: pointer
pfnCallBack: pointer
pOptItem: pointer
pDlgPage: pointer
cOptItem: uint16
cDlgPage: uint16
IconID: uint
pOptItemName: pointer
CallerVersion: uint16
OptItemVersion: uint16
dwReserved: array[4, uint]struct COMPROPSHEETUI
{
ushort cbSize;
ushort Flags;
void* hInstCaller;
void* pCallerName;
size_t UserData;
void* pHelpFile;
void* pfnCallBack;
void* pOptItem;
void* pDlgPage;
ushort cOptItem;
ushort cDlgPage;
size_t IconID;
void* pOptItemName;
ushort CallerVersion;
ushort OptItemVersion;
size_t[4] dwReserved;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; COMPROPSHEETUI サイズ: 64 バイト(x86)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; cbSize : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; Flags : WORD (+2, 2byte) wpoke st,2,値 / 値 = wpeek(st,2)
; hInstCaller : HINSTANCE (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; pCallerName : CHAR* (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; UserData : UINT_PTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; pHelpFile : CHAR* (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; pfnCallBack : _CPSUICALLBACK (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; pOptItem : OPTITEM* (+24, 4byte) varptr(st)+24 を基点に操作(4byte:入れ子/配列)
; pDlgPage : DLGPAGE* (+28, 4byte) varptr(st)+28 を基点に操作(4byte:入れ子/配列)
; cOptItem : WORD (+32, 2byte) wpoke st,32,値 / 値 = wpeek(st,32)
; cDlgPage : WORD (+34, 2byte) wpoke st,34,値 / 値 = wpeek(st,34)
; IconID : UINT_PTR (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; pOptItemName : CHAR* (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; CallerVersion : WORD (+44, 2byte) wpoke st,44,値 / 値 = wpeek(st,44)
; OptItemVersion : WORD (+46, 2byte) wpoke st,46,値 / 値 = wpeek(st,46)
; dwReserved : UINT_PTR (+48, 16byte) varptr(st)+48 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; COMPROPSHEETUI サイズ: 128 バイト(x64)
dim st, 32 ; 4byte整数×32(構造体サイズ 128 / 4 切り上げ)
; cbSize : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; Flags : WORD (+2, 2byte) wpoke st,2,値 / 値 = wpeek(st,2)
; hInstCaller : HINSTANCE (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; pCallerName : CHAR* (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; UserData : UINT_PTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; pHelpFile : CHAR* (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; pfnCallBack : _CPSUICALLBACK (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; pOptItem : OPTITEM* (+48, 8byte) varptr(st)+48 を基点に操作(8byte:入れ子/配列)
; pDlgPage : DLGPAGE* (+56, 8byte) varptr(st)+56 を基点に操作(8byte:入れ子/配列)
; cOptItem : WORD (+64, 2byte) wpoke st,64,値 / 値 = wpeek(st,64)
; cDlgPage : WORD (+66, 2byte) wpoke st,66,値 / 値 = wpeek(st,66)
; IconID : UINT_PTR (+72, 8byte) qpoke st,72,値 / qpeek(st,72) ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; pOptItemName : CHAR* (+80, 8byte) qpoke st,80,値 / qpeek(st,80) ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; CallerVersion : WORD (+88, 2byte) wpoke st,88,値 / 値 = wpeek(st,88)
; OptItemVersion : WORD (+90, 2byte) wpoke st,90,値 / 値 = wpeek(st,90)
; dwReserved : UINT_PTR (+96, 32byte) varptr(st)+96 を基点に操作(32byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global COMPROPSHEETUI
#field short cbSize
#field short Flags
#field intptr hInstCaller
#field intptr pCallerName
#field intptr UserData
#field intptr pHelpFile
#field intptr pfnCallBack
#field intptr pOptItem
#field intptr pDlgPage
#field short cOptItem
#field short cDlgPage
#field intptr IconID
#field intptr pOptItemName
#field short CallerVersion
#field short OptItemVersion
#field intptr dwReserved 4
#endstruct
stdim st, COMPROPSHEETUI ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize