ホーム › System.Ole › OleUIPromptUserW
OleUIPromptUserW
関数可変長引数指定テンプレートのOLE標準ダイアログを表示する。
シグネチャ
// oledlg.dll (Unicode / -W)
#include <windows.h>
INT OleUIPromptUserW(
INT nTemplate,
HWND hwndParent,
...
);
// ※可変長引数(printf形式・cdecl)。上記の固定引数の後に、書式に応じた引数を追加で渡します。パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| nTemplate | INT | in |
| hwndParent | HWND | in |
戻り値の型: INT
各言語での呼び出し定義
// oledlg.dll (Unicode / -W)
#include <windows.h>
INT OleUIPromptUserW(
INT nTemplate,
HWND hwndParent,
...
);
// ※可変長引数(printf形式・cdecl)。上記の固定引数の後に、書式に応じた引数を追加で渡します。[DllImport("oledlg.dll", CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern int OleUIPromptUserW(
int nTemplate, // INT
IntPtr hwndParent, // HWND
__arglist
);
// ※可変長引数(printf形式・cdecl)。上記の固定引数の後に、書式に応じた引数を追加で渡します。<DllImport("oledlg.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function OleUIPromptUserW(
nTemplate As Integer, ' INT
hwndParent As IntPtr ' HWND
) As Integer
End Function
' ※可変長引数(printf形式・cdecl)。上記の固定引数の後に、書式に応じた引数を追加で渡します。' nTemplate : INT
' hwndParent : HWND
Declare PtrSafe Function OleUIPromptUserW Lib "oledlg" ( _
ByVal nTemplate As Long, _
ByVal hwndParent As LongPtr) As Long
' Unicode(W): 文字列は ByVal As LongPtr とし StrPtr(unicodeStr) を渡す
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
' ※可変長引数(printf形式・cdecl)。上記の固定引数の後に、書式に応じた引数を追加で渡します。import ctypes
from ctypes import wintypes
OleUIPromptUserW = ctypes.cdll.oledlg.OleUIPromptUserW
OleUIPromptUserW.restype = ctypes.c_int
OleUIPromptUserW.argtypes = [
ctypes.c_int, # nTemplate : INT
wintypes.HANDLE, # hwndParent : HWND
]
# ※可変長引数(printf形式・cdecl)。上記の固定引数の後に、書式に応じた引数を追加で渡します。require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('oledlg.dll')
OleUIPromptUserW = Fiddle::Function.new(
lib['OleUIPromptUserW'],
[
Fiddle::TYPE_INT, # nTemplate : INT
Fiddle::TYPE_VOIDP, # hwndParent : HWND
],
Fiddle::TYPE_INT, Fiddle::Function::CDECL)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"
# ※可変長引数(printf形式・cdecl)。上記の固定引数の後に、書式に応じた引数を追加で渡します。#[link(name = "oledlg")]
extern "C" {
fn OleUIPromptUserW(
nTemplate: i32, // INT
hwndParent: *mut core::ffi::c_void, // HWND
...
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
// ※可変長引数(printf形式・cdecl)。上記の固定引数の後に、書式に応じた引数を追加で渡します。$sig = @"
[DllImport("oledlg.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern int OleUIPromptUserW(int nTemplate, IntPtr hwndParent);
"@
$api = Add-Type -MemberDefinition $sig -Name 'oledlg_OleUIPromptUserW' -Namespace Win32 -PassThru
# $api::OleUIPromptUserW(nTemplate, hwndParent)
# ※可変長引数(printf形式・cdecl)。上記の固定引数の後に、書式に応じた引数を追加で渡します。#uselib "oledlg.dll"
#func global OleUIPromptUserW "OleUIPromptUserW" wptr, wptr
; OleUIPromptUserW nTemplate, hwndParent ; 戻り値は stat
; nTemplate : INT -> "wptr"
; hwndParent : HWND -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
; ※可変長引数(printf形式・cdecl)。上記の固定引数の後に、書式に応じた引数を追加で渡します。#uselib "oledlg.dll"
#cfunc global OleUIPromptUserW "OleUIPromptUserW" int, sptr
; res = OleUIPromptUserW(nTemplate, hwndParent)
; nTemplate : INT -> "int"
; hwndParent : HWND -> "sptr"
; ※可変長引数(printf形式・cdecl)。上記の固定引数の後に、書式に応じた引数を追加で渡します。; INT OleUIPromptUserW(INT nTemplate, HWND hwndParent)
#uselib "oledlg.dll"
#cfunc global OleUIPromptUserW "OleUIPromptUserW" int, intptr
; res = OleUIPromptUserW(nTemplate, hwndParent)
; nTemplate : INT -> "int"
; hwndParent : HWND -> "intptr"
; ※可変長引数(printf形式・cdecl)。上記の固定引数の後に、書式に応じた引数を追加で渡します。import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
oledlg = windows.NewLazySystemDLL("oledlg.dll")
procOleUIPromptUserW = oledlg.NewProc("OleUIPromptUserW")
)
// nTemplate (INT), hwndParent (HWND)
r1, _, err := procOleUIPromptUserW.Call(
uintptr(nTemplate),
uintptr(hwndParent),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INT
// ※可変長引数(printf形式・cdecl)。上記の固定引数の後に、書式に応じた引数を追加で渡します。function OleUIPromptUserW(
nTemplate: Integer; // INT
hwndParent: THandle // HWND
): Integer; cdecl; varargs;
external 'oledlg.dll' name 'OleUIPromptUserW';
// ※可変長引数(printf形式・cdecl)。上記の固定引数の後に、書式に応じた引数を追加で渡します。result := DllCall("oledlg\OleUIPromptUserW"
, "Int", nTemplate ; INT
, "Ptr", hwndParent ; HWND
, "Cdecl Int") ; return: INT
; ※可変長引数(printf形式・cdecl)。上記の固定引数の後に、書式に応じた引数を追加で渡します。●OleUIPromptUserW(nTemplate, hwndParent) = DLL("oledlg.dll", "int OleUIPromptUserW(int, void*)")
# 呼び出し: OleUIPromptUserW(nTemplate, hwndParent)
# nTemplate : INT -> "int"
# hwndParent : HWND -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。
# ※可変長引数。DLL()は固定引数のみ。追加引数は EXEC_PTR で渡してください。
# ※可変長引数(printf形式・cdecl)。上記の固定引数の後に、書式に応じた引数を追加で渡します。