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

OleCreatePropertyFrame

関数
オブジェクトのプロパティページを表示するダイアログを生成する。
DLLOLEAUT32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

// OLEAUT32.dll
#include <windows.h>

HRESULT OleCreatePropertyFrame(
    HWND hwndOwner,
    DWORD x,
    DWORD y,
    LPCWSTR lpszCaption,
    DWORD cObjects,
    IUnknown** ppUnk,
    DWORD cPages,
    GUID* pPageClsID,
    DWORD lcid,
    DWORD dwReserved,
    void* pvReserved
);

パラメーター

名前方向
hwndOwnerHWNDin
xDWORDin
yDWORDin
lpszCaptionLPCWSTRin
cObjectsDWORDin
ppUnkIUnknown**in
cPagesDWORDin
pPageClsIDGUID*in
lcidDWORDin
dwReservedDWORDin
pvReservedvoid*in

戻り値の型: HRESULT

各言語での呼び出し定義

// OLEAUT32.dll
#include <windows.h>

HRESULT OleCreatePropertyFrame(
    HWND hwndOwner,
    DWORD x,
    DWORD y,
    LPCWSTR lpszCaption,
    DWORD cObjects,
    IUnknown** ppUnk,
    DWORD cPages,
    GUID* pPageClsID,
    DWORD lcid,
    DWORD dwReserved,
    void* pvReserved
);
[DllImport("OLEAUT32.dll", ExactSpelling = true)]
static extern int OleCreatePropertyFrame(
    IntPtr hwndOwner,   // HWND
    uint x,   // DWORD
    uint y,   // DWORD
    [MarshalAs(UnmanagedType.LPWStr)] string lpszCaption,   // LPCWSTR
    uint cObjects,   // DWORD
    IntPtr ppUnk,   // IUnknown**
    uint cPages,   // DWORD
    ref Guid pPageClsID,   // GUID*
    uint lcid,   // DWORD
    uint dwReserved,   // DWORD
    IntPtr pvReserved   // void*
);
<DllImport("OLEAUT32.dll", ExactSpelling:=True)>
Public Shared Function OleCreatePropertyFrame(
    hwndOwner As IntPtr,   ' HWND
    x As UInteger,   ' DWORD
    y As UInteger,   ' DWORD
    <MarshalAs(UnmanagedType.LPWStr)> lpszCaption As String,   ' LPCWSTR
    cObjects As UInteger,   ' DWORD
    ppUnk As IntPtr,   ' IUnknown**
    cPages As UInteger,   ' DWORD
    ByRef pPageClsID As Guid,   ' GUID*
    lcid As UInteger,   ' DWORD
    dwReserved As UInteger,   ' DWORD
    pvReserved As IntPtr   ' void*
) As Integer
End Function
' hwndOwner : HWND
' x : DWORD
' y : DWORD
' lpszCaption : LPCWSTR
' cObjects : DWORD
' ppUnk : IUnknown**
' cPages : DWORD
' pPageClsID : GUID*
' lcid : DWORD
' dwReserved : DWORD
' pvReserved : void*
Declare PtrSafe Function OleCreatePropertyFrame Lib "oleaut32" ( _
    ByVal hwndOwner As LongPtr, _
    ByVal x As Long, _
    ByVal y As Long, _
    ByVal lpszCaption As LongPtr, _
    ByVal cObjects As Long, _
    ByVal ppUnk As LongPtr, _
    ByVal cPages As Long, _
    ByVal pPageClsID As LongPtr, _
    ByVal lcid As Long, _
    ByVal dwReserved As Long, _
    ByVal pvReserved As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

OleCreatePropertyFrame = ctypes.windll.oleaut32.OleCreatePropertyFrame
OleCreatePropertyFrame.restype = ctypes.c_int
OleCreatePropertyFrame.argtypes = [
    wintypes.HANDLE,  # hwndOwner : HWND
    wintypes.DWORD,  # x : DWORD
    wintypes.DWORD,  # y : DWORD
    wintypes.LPCWSTR,  # lpszCaption : LPCWSTR
    wintypes.DWORD,  # cObjects : DWORD
    ctypes.c_void_p,  # ppUnk : IUnknown**
    wintypes.DWORD,  # cPages : DWORD
    ctypes.c_void_p,  # pPageClsID : GUID*
    wintypes.DWORD,  # lcid : DWORD
    wintypes.DWORD,  # dwReserved : DWORD
    ctypes.POINTER(None),  # pvReserved : void*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('OLEAUT32.dll')
OleCreatePropertyFrame = Fiddle::Function.new(
  lib['OleCreatePropertyFrame'],
  [
    Fiddle::TYPE_VOIDP,  # hwndOwner : HWND
    -Fiddle::TYPE_INT,  # x : DWORD
    -Fiddle::TYPE_INT,  # y : DWORD
    Fiddle::TYPE_VOIDP,  # lpszCaption : LPCWSTR
    -Fiddle::TYPE_INT,  # cObjects : DWORD
    Fiddle::TYPE_VOIDP,  # ppUnk : IUnknown**
    -Fiddle::TYPE_INT,  # cPages : DWORD
    Fiddle::TYPE_VOIDP,  # pPageClsID : GUID*
    -Fiddle::TYPE_INT,  # lcid : DWORD
    -Fiddle::TYPE_INT,  # dwReserved : DWORD
    Fiddle::TYPE_VOIDP,  # pvReserved : void*
  ],
  Fiddle::TYPE_INT)
#[link(name = "oleaut32")]
extern "system" {
    fn OleCreatePropertyFrame(
        hwndOwner: *mut core::ffi::c_void,  // HWND
        x: u32,  // DWORD
        y: u32,  // DWORD
        lpszCaption: *const u16,  // LPCWSTR
        cObjects: u32,  // DWORD
        ppUnk: *mut *mut core::ffi::c_void,  // IUnknown**
        cPages: u32,  // DWORD
        pPageClsID: *mut GUID,  // GUID*
        lcid: u32,  // DWORD
        dwReserved: u32,  // DWORD
        pvReserved: *mut ()  // void*
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("OLEAUT32.dll")]
public static extern int OleCreatePropertyFrame(IntPtr hwndOwner, uint x, uint y, [MarshalAs(UnmanagedType.LPWStr)] string lpszCaption, uint cObjects, IntPtr ppUnk, uint cPages, ref Guid pPageClsID, uint lcid, uint dwReserved, IntPtr pvReserved);
"@
$api = Add-Type -MemberDefinition $sig -Name 'OLEAUT32_OleCreatePropertyFrame' -Namespace Win32 -PassThru
# $api::OleCreatePropertyFrame(hwndOwner, x, y, lpszCaption, cObjects, ppUnk, cPages, pPageClsID, lcid, dwReserved, pvReserved)
#uselib "OLEAUT32.dll"
#func global OleCreatePropertyFrame "OleCreatePropertyFrame" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; OleCreatePropertyFrame hwndOwner, x, y, lpszCaption, cObjects, ppUnk, cPages, varptr(pPageClsID), lcid, dwReserved, pvReserved   ; 戻り値は stat
; hwndOwner : HWND -> "sptr"
; x : DWORD -> "sptr"
; y : DWORD -> "sptr"
; lpszCaption : LPCWSTR -> "sptr"
; cObjects : DWORD -> "sptr"
; ppUnk : IUnknown** -> "sptr"
; cPages : DWORD -> "sptr"
; pPageClsID : GUID* -> "sptr"
; lcid : DWORD -> "sptr"
; dwReserved : DWORD -> "sptr"
; pvReserved : void* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "OLEAUT32.dll"
#cfunc global OleCreatePropertyFrame "OleCreatePropertyFrame" sptr, int, int, wstr, int, sptr, int, var, int, int, sptr
; res = OleCreatePropertyFrame(hwndOwner, x, y, lpszCaption, cObjects, ppUnk, cPages, pPageClsID, lcid, dwReserved, pvReserved)
; hwndOwner : HWND -> "sptr"
; x : DWORD -> "int"
; y : DWORD -> "int"
; lpszCaption : LPCWSTR -> "wstr"
; cObjects : DWORD -> "int"
; ppUnk : IUnknown** -> "sptr"
; cPages : DWORD -> "int"
; pPageClsID : GUID* -> "var"
; lcid : DWORD -> "int"
; dwReserved : DWORD -> "int"
; pvReserved : void* -> "sptr"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; HRESULT OleCreatePropertyFrame(HWND hwndOwner, DWORD x, DWORD y, LPCWSTR lpszCaption, DWORD cObjects, IUnknown** ppUnk, DWORD cPages, GUID* pPageClsID, DWORD lcid, DWORD dwReserved, void* pvReserved)
#uselib "OLEAUT32.dll"
#cfunc global OleCreatePropertyFrame "OleCreatePropertyFrame" intptr, int, int, wstr, int, intptr, int, var, int, int, intptr
; res = OleCreatePropertyFrame(hwndOwner, x, y, lpszCaption, cObjects, ppUnk, cPages, pPageClsID, lcid, dwReserved, pvReserved)
; hwndOwner : HWND -> "intptr"
; x : DWORD -> "int"
; y : DWORD -> "int"
; lpszCaption : LPCWSTR -> "wstr"
; cObjects : DWORD -> "int"
; ppUnk : IUnknown** -> "intptr"
; cPages : DWORD -> "int"
; pPageClsID : GUID* -> "var"
; lcid : DWORD -> "int"
; dwReserved : DWORD -> "int"
; pvReserved : void* -> "intptr"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	oleaut32 = windows.NewLazySystemDLL("OLEAUT32.dll")
	procOleCreatePropertyFrame = oleaut32.NewProc("OleCreatePropertyFrame")
)

// hwndOwner (HWND), x (DWORD), y (DWORD), lpszCaption (LPCWSTR), cObjects (DWORD), ppUnk (IUnknown**), cPages (DWORD), pPageClsID (GUID*), lcid (DWORD), dwReserved (DWORD), pvReserved (void*)
r1, _, err := procOleCreatePropertyFrame.Call(
	uintptr(hwndOwner),
	uintptr(x),
	uintptr(y),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(lpszCaption))),
	uintptr(cObjects),
	uintptr(ppUnk),
	uintptr(cPages),
	uintptr(pPageClsID),
	uintptr(lcid),
	uintptr(dwReserved),
	uintptr(pvReserved),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function OleCreatePropertyFrame(
  hwndOwner: THandle;   // HWND
  x: DWORD;   // DWORD
  y: DWORD;   // DWORD
  lpszCaption: PWideChar;   // LPCWSTR
  cObjects: DWORD;   // DWORD
  ppUnk: Pointer;   // IUnknown**
  cPages: DWORD;   // DWORD
  pPageClsID: PGUID;   // GUID*
  lcid: DWORD;   // DWORD
  dwReserved: DWORD;   // DWORD
  pvReserved: Pointer   // void*
): Integer; stdcall;
  external 'OLEAUT32.dll' name 'OleCreatePropertyFrame';
result := DllCall("OLEAUT32\OleCreatePropertyFrame"
    , "Ptr", hwndOwner   ; HWND
    , "UInt", x   ; DWORD
    , "UInt", y   ; DWORD
    , "WStr", lpszCaption   ; LPCWSTR
    , "UInt", cObjects   ; DWORD
    , "Ptr", ppUnk   ; IUnknown**
    , "UInt", cPages   ; DWORD
    , "Ptr", pPageClsID   ; GUID*
    , "UInt", lcid   ; DWORD
    , "UInt", dwReserved   ; DWORD
    , "Ptr", pvReserved   ; void*
    , "Int")   ; return: HRESULT
●OleCreatePropertyFrame(hwndOwner, x, y, lpszCaption, cObjects, ppUnk, cPages, pPageClsID, lcid, dwReserved, pvReserved) = DLL("OLEAUT32.dll", "int OleCreatePropertyFrame(void*, dword, dword, char*, dword, void*, dword, void*, dword, dword, void*)")
# 呼び出し: OleCreatePropertyFrame(hwndOwner, x, y, lpszCaption, cObjects, ppUnk, cPages, pPageClsID, lcid, dwReserved, pvReserved)
# hwndOwner : HWND -> "void*"
# x : DWORD -> "dword"
# y : DWORD -> "dword"
# lpszCaption : LPCWSTR -> "char*"
# cObjects : DWORD -> "dword"
# ppUnk : IUnknown** -> "void*"
# cPages : DWORD -> "dword"
# pPageClsID : GUID* -> "void*"
# lcid : DWORD -> "dword"
# dwReserved : DWORD -> "dword"
# pvReserved : void* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。