ホーム › System.WinRT › CreateControlInputEx
CreateControlInputEx
関数コアウィンドウを指定してコントロール入力オブジェクトを生成する。
シグネチャ
// Windows.UI.dll
#include <windows.h>
HRESULT CreateControlInputEx(
IUnknown* pCoreWindow,
const GUID* riid,
void** ppv
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pCoreWindow | IUnknown* | in |
| riid | GUID* | in |
| ppv | void** | out |
戻り値の型: HRESULT
各言語での呼び出し定義
// Windows.UI.dll
#include <windows.h>
HRESULT CreateControlInputEx(
IUnknown* pCoreWindow,
const GUID* riid,
void** ppv
);[DllImport("Windows.UI.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern int CreateControlInputEx(
IntPtr pCoreWindow, // IUnknown*
ref Guid riid, // GUID*
IntPtr ppv // void** out
);<DllImport("Windows.UI.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function CreateControlInputEx(
pCoreWindow As IntPtr, ' IUnknown*
ByRef riid As Guid, ' GUID*
ppv As IntPtr ' void** out
) As Integer
End Function' pCoreWindow : IUnknown*
' riid : GUID*
' ppv : void** out
Declare PtrSafe Function CreateControlInputEx Lib "windows.ui" ( _
ByVal pCoreWindow As LongPtr, _
ByVal riid As LongPtr, _
ByVal ppv As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
CreateControlInputEx = ctypes.cdll.LoadLibrary("Windows.UI.dll").CreateControlInputEx
CreateControlInputEx.restype = ctypes.c_int
CreateControlInputEx.argtypes = [
ctypes.c_void_p, # pCoreWindow : IUnknown*
ctypes.c_void_p, # riid : GUID*
ctypes.c_void_p, # ppv : void** out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('Windows.UI.dll')
CreateControlInputEx = Fiddle::Function.new(
lib['CreateControlInputEx'],
[
Fiddle::TYPE_VOIDP, # pCoreWindow : IUnknown*
Fiddle::TYPE_VOIDP, # riid : GUID*
Fiddle::TYPE_VOIDP, # ppv : void** out
],
Fiddle::TYPE_INT, Fiddle::Function::CDECL)#[link(name = "windows.ui")]
extern "C" {
fn CreateControlInputEx(
pCoreWindow: *mut core::ffi::c_void, // IUnknown*
riid: *const GUID, // GUID*
ppv: *mut *mut () // void** out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("Windows.UI.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int CreateControlInputEx(IntPtr pCoreWindow, ref Guid riid, IntPtr ppv);
"@
$api = Add-Type -MemberDefinition $sig -Name 'Windows.UI_CreateControlInputEx' -Namespace Win32 -PassThru
# $api::CreateControlInputEx(pCoreWindow, riid, ppv)#uselib "Windows.UI.dll"
#func global CreateControlInputEx "CreateControlInputEx" sptr, sptr, sptr
; CreateControlInputEx pCoreWindow, varptr(riid), ppv ; 戻り値は stat
; pCoreWindow : IUnknown* -> "sptr"
; riid : GUID* -> "sptr"
; ppv : void** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "Windows.UI.dll" #cfunc global CreateControlInputEx "CreateControlInputEx" sptr, var, sptr ; res = CreateControlInputEx(pCoreWindow, riid, ppv) ; pCoreWindow : IUnknown* -> "sptr" ; riid : GUID* -> "var" ; ppv : void** out -> "sptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "Windows.UI.dll" #cfunc global CreateControlInputEx "CreateControlInputEx" sptr, sptr, sptr ; res = CreateControlInputEx(pCoreWindow, varptr(riid), ppv) ; pCoreWindow : IUnknown* -> "sptr" ; riid : GUID* -> "sptr" ; ppv : void** out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT CreateControlInputEx(IUnknown* pCoreWindow, GUID* riid, void** ppv) #uselib "Windows.UI.dll" #cfunc global CreateControlInputEx "CreateControlInputEx" intptr, var, intptr ; res = CreateControlInputEx(pCoreWindow, riid, ppv) ; pCoreWindow : IUnknown* -> "intptr" ; riid : GUID* -> "var" ; ppv : void** out -> "intptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT CreateControlInputEx(IUnknown* pCoreWindow, GUID* riid, void** ppv) #uselib "Windows.UI.dll" #cfunc global CreateControlInputEx "CreateControlInputEx" intptr, intptr, intptr ; res = CreateControlInputEx(pCoreWindow, varptr(riid), ppv) ; pCoreWindow : IUnknown* -> "intptr" ; riid : GUID* -> "intptr" ; ppv : void** out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
windows_ui = windows.NewLazySystemDLL("Windows.UI.dll")
procCreateControlInputEx = windows_ui.NewProc("CreateControlInputEx")
)
// pCoreWindow (IUnknown*), riid (GUID*), ppv (void** out)
r1, _, err := procCreateControlInputEx.Call(
uintptr(pCoreWindow),
uintptr(riid),
uintptr(ppv),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction CreateControlInputEx(
pCoreWindow: Pointer; // IUnknown*
riid: PGUID; // GUID*
ppv: Pointer // void** out
): Integer; cdecl;
external 'Windows.UI.dll' name 'CreateControlInputEx';result := DllCall("Windows.UI\CreateControlInputEx"
, "Ptr", pCoreWindow ; IUnknown*
, "Ptr", riid ; GUID*
, "Ptr", ppv ; void** out
, "Cdecl Int") ; return: HRESULT●CreateControlInputEx(pCoreWindow, riid, ppv) = DLL("Windows.UI.dll", "int CreateControlInputEx(void*, void*, void*)")
# 呼び出し: CreateControlInputEx(pCoreWindow, riid, ppv)
# pCoreWindow : IUnknown* -> "void*"
# riid : GUID* -> "void*"
# ppv : void** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。