ホーム › System.AddressBook › WABIMPORTPARAM
WABIMPORTPARAM
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | この構造体のバイトサイズ。 |
| lpAdrBook | IAddrBook* | 8/4 | +8 | +4 | インポート先となるアドレス帳のIAddrBookインターフェイスへのポインタ。 |
| hWnd | HWND | 8/4 | +16 | +8 | インポートダイアログの親ウィンドウハンドル。NULL可。 |
| ulFlags | DWORD | 4 | +24 | +12 | インポート動作を制御するフラグ。 |
| lpszFileName | LPSTR | 8/4 | +32 | +16 | インポート元ファイルのパス文字列へのポインタ。 |
各言語での定義
#include <windows.h>
// WABIMPORTPARAM (x64 40 / x86 20 バイト)
typedef struct WABIMPORTPARAM {
DWORD cbSize;
IAddrBook* lpAdrBook;
HWND hWnd;
DWORD ulFlags;
LPSTR lpszFileName;
} WABIMPORTPARAM;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WABIMPORTPARAM
{
public uint cbSize;
public IntPtr lpAdrBook;
public IntPtr hWnd;
public uint ulFlags;
public IntPtr lpszFileName;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WABIMPORTPARAM
Public cbSize As UInteger
Public lpAdrBook As IntPtr
Public hWnd As IntPtr
Public ulFlags As UInteger
Public lpszFileName As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class WABIMPORTPARAM(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("lpAdrBook", ctypes.c_void_p),
("hWnd", ctypes.c_void_p),
("ulFlags", wintypes.DWORD),
("lpszFileName", ctypes.c_void_p),
]#[repr(C)]
pub struct WABIMPORTPARAM {
pub cbSize: u32,
pub lpAdrBook: *mut core::ffi::c_void,
pub hWnd: *mut core::ffi::c_void,
pub ulFlags: u32,
pub lpszFileName: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type WABIMPORTPARAM struct {
cbSize uint32
lpAdrBook uintptr
hWnd uintptr
ulFlags uint32
lpszFileName uintptr
}type
WABIMPORTPARAM = record
cbSize: DWORD;
lpAdrBook: Pointer;
hWnd: Pointer;
ulFlags: DWORD;
lpszFileName: Pointer;
end;const WABIMPORTPARAM = extern struct {
cbSize: u32,
lpAdrBook: ?*anyopaque,
hWnd: ?*anyopaque,
ulFlags: u32,
lpszFileName: ?*anyopaque,
};type
WABIMPORTPARAM {.bycopy.} = object
cbSize: uint32
lpAdrBook: pointer
hWnd: pointer
ulFlags: uint32
lpszFileName: pointerstruct WABIMPORTPARAM
{
uint cbSize;
void* lpAdrBook;
void* hWnd;
uint ulFlags;
void* lpszFileName;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; WABIMPORTPARAM サイズ: 20 バイト(x86)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; lpAdrBook : IAddrBook* (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; hWnd : HWND (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ulFlags : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; lpszFileName : LPSTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WABIMPORTPARAM サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; lpAdrBook : IAddrBook* (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; hWnd : HWND (+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 も可)
; lpszFileName : LPSTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WABIMPORTPARAM
#field int cbSize
#field intptr lpAdrBook
#field intptr hWnd
#field int ulFlags
#field intptr lpszFileName
#endstruct
stdim st, WABIMPORTPARAM ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize