ホーム › System.AddressBook › WAB_PARAM
WAB_PARAM
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | この構造体のバイトサイズ。互換性確認のため呼び出し側が設定する。 |
| hwnd | HWND | 8/4 | +8 | +4 | WABダイアログの親ウィンドウハンドル。NULL可。 |
| szFileName | LPSTR | 8/4 | +16 | +8 | 使用するWABファイル(.wab)のパス文字列へのポインタ。NULL可。 |
| ulFlags | DWORD | 4 | +24 | +12 | WAB初期化動作を制御するフラグ。WAB_ENABLE_PROFILES等を指定する。 |
| guidPSExt | GUID | 16 | +28 | +16 | プロパティシート拡張を識別するGUID。 |
各言語での定義
#include <windows.h>
// WAB_PARAM (x64 48 / x86 32 バイト)
typedef struct WAB_PARAM {
DWORD cbSize;
HWND hwnd;
LPSTR szFileName;
DWORD ulFlags;
GUID guidPSExt;
} WAB_PARAM;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WAB_PARAM
{
public uint cbSize;
public IntPtr hwnd;
public IntPtr szFileName;
public uint ulFlags;
public Guid guidPSExt;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WAB_PARAM
Public cbSize As UInteger
Public hwnd As IntPtr
Public szFileName As IntPtr
Public ulFlags As UInteger
Public guidPSExt As Guid
End Structureimport ctypes
from ctypes import wintypes
class WAB_PARAM(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("hwnd", ctypes.c_void_p),
("szFileName", ctypes.c_void_p),
("ulFlags", wintypes.DWORD),
("guidPSExt", GUID),
]#[repr(C)]
pub struct WAB_PARAM {
pub cbSize: u32,
pub hwnd: *mut core::ffi::c_void,
pub szFileName: *mut core::ffi::c_void,
pub ulFlags: u32,
pub guidPSExt: GUID,
}import "golang.org/x/sys/windows"
type WAB_PARAM struct {
cbSize uint32
hwnd uintptr
szFileName uintptr
ulFlags uint32
guidPSExt windows.GUID
}type
WAB_PARAM = record
cbSize: DWORD;
hwnd: Pointer;
szFileName: Pointer;
ulFlags: DWORD;
guidPSExt: TGUID;
end;const WAB_PARAM = extern struct {
cbSize: u32,
hwnd: ?*anyopaque,
szFileName: ?*anyopaque,
ulFlags: u32,
guidPSExt: GUID,
};type
WAB_PARAM {.bycopy.} = object
cbSize: uint32
hwnd: pointer
szFileName: pointer
ulFlags: uint32
guidPSExt: GUIDstruct WAB_PARAM
{
uint cbSize;
void* hwnd;
void* szFileName;
uint ulFlags;
GUID guidPSExt;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; WAB_PARAM サイズ: 32 バイト(x86)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; hwnd : HWND (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; szFileName : LPSTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ulFlags : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; guidPSExt : GUID (+16, 16byte) varptr(st)+16 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WAB_PARAM サイズ: 48 バイト(x64)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; hwnd : HWND (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; szFileName : LPSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; ulFlags : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; guidPSExt : GUID (+28, 16byte) varptr(st)+28 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
#field int Data1
#field short Data2
#field short Data3
#field byte Data4 8
#endstruct
#defstruct global WAB_PARAM
#field int cbSize
#field intptr hwnd
#field intptr szFileName
#field int ulFlags
#field GUID guidPSExt
#endstruct
stdim st, WAB_PARAM ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize