Win32 API 日本語リファレンス
ホームSystem.Ole › OCPFIPARAMS

OCPFIPARAMS

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

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

フィールド

フィールドサイズx64x86説明
cbStructSizeDWORD4+0+0この構造体のサイズをバイト単位で表す。
hWndOwnerHWND8/4+8+4プロパティフレームの親ウィンドウのハンドルである。
xINT4+16+8ダイアログ表示位置のX座標である。
yINT4+20+12ダイアログ表示位置のY座標である。
lpszCaptionLPWSTR8/4+24+16プロパティフレームのタイトルバー文字列である。
cObjectsDWORD4+32+20対象オブジェクトの個数を表す。
lplpUnkIUnknown**8/4+40+24対象オブジェクトのIUnknownポインタ配列へのポインタである。
cPagesDWORD4+48+28表示するプロパティページの個数を表す。
lpPagesGUID*8/4+56+32表示するプロパティページのCLSID(GUID)配列へのポインタである。
lcidDWORD4+64+36ロケールID(LCID)である。
dispidInitialPropertyINT4+68+40最初に選択するプロパティのDISPIDである。

各言語での定義

#include <windows.h>

// OCPFIPARAMS  (x64 72 / x86 44 バイト)
typedef struct OCPFIPARAMS {
    DWORD cbStructSize;
    HWND hWndOwner;
    INT x;
    INT y;
    LPWSTR lpszCaption;
    DWORD cObjects;
    IUnknown** lplpUnk;
    DWORD cPages;
    GUID* lpPages;
    DWORD lcid;
    INT dispidInitialProperty;
} OCPFIPARAMS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct OCPFIPARAMS
{
    public uint cbStructSize;
    public IntPtr hWndOwner;
    public int x;
    public int y;
    public IntPtr lpszCaption;
    public uint cObjects;
    public IntPtr lplpUnk;
    public uint cPages;
    public IntPtr lpPages;
    public uint lcid;
    public int dispidInitialProperty;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure OCPFIPARAMS
    Public cbStructSize As UInteger
    Public hWndOwner As IntPtr
    Public x As Integer
    Public y As Integer
    Public lpszCaption As IntPtr
    Public cObjects As UInteger
    Public lplpUnk As IntPtr
    Public cPages As UInteger
    Public lpPages As IntPtr
    Public lcid As UInteger
    Public dispidInitialProperty As Integer
End Structure
import ctypes
from ctypes import wintypes

class OCPFIPARAMS(ctypes.Structure):
    _fields_ = [
        ("cbStructSize", wintypes.DWORD),
        ("hWndOwner", ctypes.c_void_p),
        ("x", ctypes.c_int),
        ("y", ctypes.c_int),
        ("lpszCaption", ctypes.c_void_p),
        ("cObjects", wintypes.DWORD),
        ("lplpUnk", ctypes.c_void_p),
        ("cPages", wintypes.DWORD),
        ("lpPages", ctypes.c_void_p),
        ("lcid", wintypes.DWORD),
        ("dispidInitialProperty", ctypes.c_int),
    ]
#[repr(C)]
pub struct OCPFIPARAMS {
    pub cbStructSize: u32,
    pub hWndOwner: *mut core::ffi::c_void,
    pub x: i32,
    pub y: i32,
    pub lpszCaption: *mut core::ffi::c_void,
    pub cObjects: u32,
    pub lplpUnk: *mut core::ffi::c_void,
    pub cPages: u32,
    pub lpPages: *mut core::ffi::c_void,
    pub lcid: u32,
    pub dispidInitialProperty: i32,
}
import "golang.org/x/sys/windows"

type OCPFIPARAMS struct {
	cbStructSize uint32
	hWndOwner uintptr
	x int32
	y int32
	lpszCaption uintptr
	cObjects uint32
	lplpUnk uintptr
	cPages uint32
	lpPages uintptr
	lcid uint32
	dispidInitialProperty int32
}
type
  OCPFIPARAMS = record
    cbStructSize: DWORD;
    hWndOwner: Pointer;
    x: Integer;
    y: Integer;
    lpszCaption: Pointer;
    cObjects: DWORD;
    lplpUnk: Pointer;
    cPages: DWORD;
    lpPages: Pointer;
    lcid: DWORD;
    dispidInitialProperty: Integer;
  end;
const OCPFIPARAMS = extern struct {
    cbStructSize: u32,
    hWndOwner: ?*anyopaque,
    x: i32,
    y: i32,
    lpszCaption: ?*anyopaque,
    cObjects: u32,
    lplpUnk: ?*anyopaque,
    cPages: u32,
    lpPages: ?*anyopaque,
    lcid: u32,
    dispidInitialProperty: i32,
};
type
  OCPFIPARAMS {.bycopy.} = object
    cbStructSize: uint32
    hWndOwner: pointer
    x: int32
    y: int32
    lpszCaption: pointer
    cObjects: uint32
    lplpUnk: pointer
    cPages: uint32
    lpPages: pointer
    lcid: uint32
    dispidInitialProperty: int32
struct OCPFIPARAMS
{
    uint cbStructSize;
    void* hWndOwner;
    int x;
    int y;
    void* lpszCaption;
    uint cObjects;
    void* lplpUnk;
    uint cPages;
    void* lpPages;
    uint lcid;
    int dispidInitialProperty;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; OCPFIPARAMS サイズ: 44 バイト(x86)
dim st, 11    ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; cbStructSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; hWndOwner : HWND (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; x : INT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; y : INT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; lpszCaption : LPWSTR (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; cObjects : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; lplpUnk : IUnknown** (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; cPages : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; lpPages : GUID* (+32, 4byte)  varptr(st)+32 を基点に操作(4byte:入れ子/配列)
; lcid : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; dispidInitialProperty : INT (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; OCPFIPARAMS サイズ: 72 バイト(x64)
dim st, 18    ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; cbStructSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; hWndOwner : HWND (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; x : INT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; y : INT (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; lpszCaption : LPWSTR (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; cObjects : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; lplpUnk : IUnknown** (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; cPages : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; lpPages : GUID* (+56, 8byte)  varptr(st)+56 を基点に操作(8byte:入れ子/配列)
; lcid : DWORD (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; dispidInitialProperty : INT (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global OCPFIPARAMS
    #field int cbStructSize
    #field intptr hWndOwner
    #field int x
    #field int y
    #field intptr lpszCaption
    #field int cObjects
    #field intptr lplpUnk
    #field int cPages
    #field intptr lpPages
    #field int lcid
    #field int dispidInitialProperty
#endstruct

stdim st, OCPFIPARAMS        ; NSTRUCT 変数を確保
st->cbStructSize = 100
mes "cbStructSize=" + st->cbStructSize