ホーム › Graphics.Printing › EXTCHKBOX
EXTCHKBOX
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | WORD | 2 | +0 | +0 | 本構造体のサイズ(バイト単位)。 |
| Flags | WORD | 2 | +2 | +2 | 拡張チェックボックスの動作を制御するビットフラグ。 |
| pTitle | CHAR* | 8/4 | +8 | +4 | チェックボックスのタイトル文字列へのポインタ。 |
| pSeparator | CHAR* | 8/4 | +16 | +8 | タイトルと状態名の区切り文字列へのポインタ。NULL可。 |
| pCheckedName | CHAR* | 8/4 | +24 | +12 | チェック状態時に表示する名称文字列へのポインタ。 |
| IconID | UINT_PTR | 8/4 | +32 | +16 | 関連付けるアイコンのリソースID。 |
| wReserved | WORD | 8 | +40 | +20 | 予約フィールド。0を設定する。 |
| dwReserved | UINT_PTR | 16/8 | +48 | +28 | 予約フィールド。0を設定する。 |
各言語での定義
#include <windows.h>
// EXTCHKBOX (x64 64 / x86 36 バイト)
typedef struct EXTCHKBOX {
WORD cbSize;
WORD Flags;
CHAR* pTitle;
CHAR* pSeparator;
CHAR* pCheckedName;
UINT_PTR IconID;
WORD wReserved[4];
UINT_PTR dwReserved[2];
} EXTCHKBOX;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct EXTCHKBOX
{
public ushort cbSize;
public ushort Flags;
public IntPtr pTitle;
public IntPtr pSeparator;
public IntPtr pCheckedName;
public UIntPtr IconID;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public ushort[] wReserved;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public UIntPtr[] dwReserved;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure EXTCHKBOX
Public cbSize As UShort
Public Flags As UShort
Public pTitle As IntPtr
Public pSeparator As IntPtr
Public pCheckedName As IntPtr
Public IconID As UIntPtr
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=4)> Public wReserved() As UShort
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=2)> Public dwReserved() As UIntPtr
End Structureimport ctypes
from ctypes import wintypes
class EXTCHKBOX(ctypes.Structure):
_fields_ = [
("cbSize", ctypes.c_ushort),
("Flags", ctypes.c_ushort),
("pTitle", ctypes.c_void_p),
("pSeparator", ctypes.c_void_p),
("pCheckedName", ctypes.c_void_p),
("IconID", ctypes.c_size_t),
("wReserved", ctypes.c_ushort * 4),
("dwReserved", ctypes.c_size_t * 2),
]#[repr(C)]
pub struct EXTCHKBOX {
pub cbSize: u16,
pub Flags: u16,
pub pTitle: *mut core::ffi::c_void,
pub pSeparator: *mut core::ffi::c_void,
pub pCheckedName: *mut core::ffi::c_void,
pub IconID: usize,
pub wReserved: [u16; 4],
pub dwReserved: [usize; 2],
}import "golang.org/x/sys/windows"
type EXTCHKBOX struct {
cbSize uint16
Flags uint16
pTitle uintptr
pSeparator uintptr
pCheckedName uintptr
IconID uintptr
wReserved [4]uint16
dwReserved [2]uintptr
}type
EXTCHKBOX = record
cbSize: Word;
Flags: Word;
pTitle: Pointer;
pSeparator: Pointer;
pCheckedName: Pointer;
IconID: NativeUInt;
wReserved: array[0..3] of Word;
dwReserved: array[0..1] of NativeUInt;
end;const EXTCHKBOX = extern struct {
cbSize: u16,
Flags: u16,
pTitle: ?*anyopaque,
pSeparator: ?*anyopaque,
pCheckedName: ?*anyopaque,
IconID: usize,
wReserved: [4]u16,
dwReserved: [2]usize,
};type
EXTCHKBOX {.bycopy.} = object
cbSize: uint16
Flags: uint16
pTitle: pointer
pSeparator: pointer
pCheckedName: pointer
IconID: uint
wReserved: array[4, uint16]
dwReserved: array[2, uint]struct EXTCHKBOX
{
ushort cbSize;
ushort Flags;
void* pTitle;
void* pSeparator;
void* pCheckedName;
size_t IconID;
ushort[4] wReserved;
size_t[2] dwReserved;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; EXTCHKBOX サイズ: 36 バイト(x86)
dim st, 9 ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; cbSize : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; Flags : WORD (+2, 2byte) wpoke st,2,値 / 値 = wpeek(st,2)
; pTitle : CHAR* (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; pSeparator : CHAR* (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; pCheckedName : CHAR* (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; IconID : UINT_PTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; wReserved : WORD (+20, 8byte) varptr(st)+20 を基点に操作(8byte:入れ子/配列)
; dwReserved : UINT_PTR (+28, 8byte) varptr(st)+28 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; EXTCHKBOX サイズ: 64 バイト(x64)
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)
; pTitle : CHAR* (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; pSeparator : CHAR* (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; pCheckedName : CHAR* (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; IconID : UINT_PTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; wReserved : WORD (+40, 8byte) varptr(st)+40 を基点に操作(8byte:入れ子/配列)
; dwReserved : UINT_PTR (+48, 16byte) varptr(st)+48 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global EXTCHKBOX
#field short cbSize
#field short Flags
#field intptr pTitle
#field intptr pSeparator
#field intptr pCheckedName
#field intptr IconID
#field short wReserved 4
#field intptr dwReserved 2
#endstruct
stdim st, EXTCHKBOX ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize