ホーム › Graphics.Printing › CommonPropertySheetUIA
CommonPropertySheetUIA
関数共通UIプロパティシートを表示する(ANSI版)。
シグネチャ
// COMPSTUI.dll (ANSI / -A)
#include <windows.h>
INT CommonPropertySheetUIA(
HWND hWndOwner,
PFNPROPSHEETUI pfnPropSheetUI,
LPARAM lParam,
DWORD* pResult // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hWndOwner | HWND | in |
| pfnPropSheetUI | PFNPROPSHEETUI | in |
| lParam | LPARAM | in |
| pResult | DWORD* | outoptional |
戻り値の型: INT
各言語での呼び出し定義
// COMPSTUI.dll (ANSI / -A)
#include <windows.h>
INT CommonPropertySheetUIA(
HWND hWndOwner,
PFNPROPSHEETUI pfnPropSheetUI,
LPARAM lParam,
DWORD* pResult // optional
);[DllImport("COMPSTUI.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int CommonPropertySheetUIA(
IntPtr hWndOwner, // HWND
IntPtr pfnPropSheetUI, // PFNPROPSHEETUI
IntPtr lParam, // LPARAM
IntPtr pResult // DWORD* optional, out
);<DllImport("COMPSTUI.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function CommonPropertySheetUIA(
hWndOwner As IntPtr, ' HWND
pfnPropSheetUI As IntPtr, ' PFNPROPSHEETUI
lParam As IntPtr, ' LPARAM
pResult As IntPtr ' DWORD* optional, out
) As Integer
End Function' hWndOwner : HWND
' pfnPropSheetUI : PFNPROPSHEETUI
' lParam : LPARAM
' pResult : DWORD* optional, out
Declare PtrSafe Function CommonPropertySheetUIA Lib "compstui" ( _
ByVal hWndOwner As LongPtr, _
ByVal pfnPropSheetUI As LongPtr, _
ByVal lParam As LongPtr, _
ByVal pResult As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
CommonPropertySheetUIA = ctypes.windll.compstui.CommonPropertySheetUIA
CommonPropertySheetUIA.restype = ctypes.c_int
CommonPropertySheetUIA.argtypes = [
wintypes.HANDLE, # hWndOwner : HWND
ctypes.c_void_p, # pfnPropSheetUI : PFNPROPSHEETUI
ctypes.c_ssize_t, # lParam : LPARAM
ctypes.POINTER(wintypes.DWORD), # pResult : DWORD* optional, out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('COMPSTUI.dll')
CommonPropertySheetUIA = Fiddle::Function.new(
lib['CommonPropertySheetUIA'],
[
Fiddle::TYPE_VOIDP, # hWndOwner : HWND
Fiddle::TYPE_VOIDP, # pfnPropSheetUI : PFNPROPSHEETUI
Fiddle::TYPE_INTPTR_T, # lParam : LPARAM
Fiddle::TYPE_VOIDP, # pResult : DWORD* optional, out
],
Fiddle::TYPE_INT)#[link(name = "compstui")]
extern "system" {
fn CommonPropertySheetUIA(
hWndOwner: *mut core::ffi::c_void, // HWND
pfnPropSheetUI: *const core::ffi::c_void, // PFNPROPSHEETUI
lParam: isize, // LPARAM
pResult: *mut u32 // DWORD* optional, out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("COMPSTUI.dll", CharSet = CharSet.Ansi)]
public static extern int CommonPropertySheetUIA(IntPtr hWndOwner, IntPtr pfnPropSheetUI, IntPtr lParam, IntPtr pResult);
"@
$api = Add-Type -MemberDefinition $sig -Name 'COMPSTUI_CommonPropertySheetUIA' -Namespace Win32 -PassThru
# $api::CommonPropertySheetUIA(hWndOwner, pfnPropSheetUI, lParam, pResult)#uselib "COMPSTUI.dll"
#func global CommonPropertySheetUIA "CommonPropertySheetUIA" sptr, sptr, sptr, sptr
; CommonPropertySheetUIA hWndOwner, pfnPropSheetUI, lParam, varptr(pResult) ; 戻り値は stat
; hWndOwner : HWND -> "sptr"
; pfnPropSheetUI : PFNPROPSHEETUI -> "sptr"
; lParam : LPARAM -> "sptr"
; pResult : DWORD* optional, out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "COMPSTUI.dll" #cfunc global CommonPropertySheetUIA "CommonPropertySheetUIA" sptr, sptr, sptr, var ; res = CommonPropertySheetUIA(hWndOwner, pfnPropSheetUI, lParam, pResult) ; hWndOwner : HWND -> "sptr" ; pfnPropSheetUI : PFNPROPSHEETUI -> "sptr" ; lParam : LPARAM -> "sptr" ; pResult : DWORD* optional, out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "COMPSTUI.dll" #cfunc global CommonPropertySheetUIA "CommonPropertySheetUIA" sptr, sptr, sptr, sptr ; res = CommonPropertySheetUIA(hWndOwner, pfnPropSheetUI, lParam, varptr(pResult)) ; hWndOwner : HWND -> "sptr" ; pfnPropSheetUI : PFNPROPSHEETUI -> "sptr" ; lParam : LPARAM -> "sptr" ; pResult : DWORD* optional, out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; INT CommonPropertySheetUIA(HWND hWndOwner, PFNPROPSHEETUI pfnPropSheetUI, LPARAM lParam, DWORD* pResult) #uselib "COMPSTUI.dll" #cfunc global CommonPropertySheetUIA "CommonPropertySheetUIA" intptr, intptr, intptr, var ; res = CommonPropertySheetUIA(hWndOwner, pfnPropSheetUI, lParam, pResult) ; hWndOwner : HWND -> "intptr" ; pfnPropSheetUI : PFNPROPSHEETUI -> "intptr" ; lParam : LPARAM -> "intptr" ; pResult : DWORD* optional, out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; INT CommonPropertySheetUIA(HWND hWndOwner, PFNPROPSHEETUI pfnPropSheetUI, LPARAM lParam, DWORD* pResult) #uselib "COMPSTUI.dll" #cfunc global CommonPropertySheetUIA "CommonPropertySheetUIA" intptr, intptr, intptr, intptr ; res = CommonPropertySheetUIA(hWndOwner, pfnPropSheetUI, lParam, varptr(pResult)) ; hWndOwner : HWND -> "intptr" ; pfnPropSheetUI : PFNPROPSHEETUI -> "intptr" ; lParam : LPARAM -> "intptr" ; pResult : DWORD* optional, out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
compstui = windows.NewLazySystemDLL("COMPSTUI.dll")
procCommonPropertySheetUIA = compstui.NewProc("CommonPropertySheetUIA")
)
// hWndOwner (HWND), pfnPropSheetUI (PFNPROPSHEETUI), lParam (LPARAM), pResult (DWORD* optional, out)
r1, _, err := procCommonPropertySheetUIA.Call(
uintptr(hWndOwner),
uintptr(pfnPropSheetUI),
uintptr(lParam),
uintptr(pResult),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction CommonPropertySheetUIA(
hWndOwner: THandle; // HWND
pfnPropSheetUI: Pointer; // PFNPROPSHEETUI
lParam: NativeInt; // LPARAM
pResult: Pointer // DWORD* optional, out
): Integer; stdcall;
external 'COMPSTUI.dll' name 'CommonPropertySheetUIA';result := DllCall("COMPSTUI\CommonPropertySheetUIA"
, "Ptr", hWndOwner ; HWND
, "Ptr", pfnPropSheetUI ; PFNPROPSHEETUI
, "Ptr", lParam ; LPARAM
, "Ptr", pResult ; DWORD* optional, out
, "Int") ; return: INT●CommonPropertySheetUIA(hWndOwner, pfnPropSheetUI, lParam, pResult) = DLL("COMPSTUI.dll", "int CommonPropertySheetUIA(void*, void*, int, void*)")
# 呼び出し: CommonPropertySheetUIA(hWndOwner, pfnPropSheetUI, lParam, pResult)
# hWndOwner : HWND -> "void*"
# pfnPropSheetUI : PFNPROPSHEETUI -> "void*"
# lParam : LPARAM -> "int"
# pResult : DWORD* optional, out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。