ホーム › UI.InteractionContext › CreateInteractionContext
CreateInteractionContext
関数新しいインタラクションコンテキストを作成する。
シグネチャ
// NInput.dll
#include <windows.h>
HRESULT CreateInteractionContext(
HINTERACTIONCONTEXT* interactionContext
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| interactionContext | HINTERACTIONCONTEXT* | out |
戻り値の型: HRESULT
各言語での呼び出し定義
// NInput.dll
#include <windows.h>
HRESULT CreateInteractionContext(
HINTERACTIONCONTEXT* interactionContext
);[DllImport("NInput.dll", ExactSpelling = true)]
static extern int CreateInteractionContext(
IntPtr interactionContext // HINTERACTIONCONTEXT* out
);<DllImport("NInput.dll", ExactSpelling:=True)>
Public Shared Function CreateInteractionContext(
interactionContext As IntPtr ' HINTERACTIONCONTEXT* out
) As Integer
End Function' interactionContext : HINTERACTIONCONTEXT* out
Declare PtrSafe Function CreateInteractionContext Lib "ninput" ( _
ByVal interactionContext As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
CreateInteractionContext = ctypes.windll.ninput.CreateInteractionContext
CreateInteractionContext.restype = ctypes.c_int
CreateInteractionContext.argtypes = [
ctypes.c_void_p, # interactionContext : HINTERACTIONCONTEXT* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('NInput.dll')
CreateInteractionContext = Fiddle::Function.new(
lib['CreateInteractionContext'],
[
Fiddle::TYPE_VOIDP, # interactionContext : HINTERACTIONCONTEXT* out
],
Fiddle::TYPE_INT)#[link(name = "ninput")]
extern "system" {
fn CreateInteractionContext(
interactionContext: *mut *mut core::ffi::c_void // HINTERACTIONCONTEXT* out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("NInput.dll")]
public static extern int CreateInteractionContext(IntPtr interactionContext);
"@
$api = Add-Type -MemberDefinition $sig -Name 'NInput_CreateInteractionContext' -Namespace Win32 -PassThru
# $api::CreateInteractionContext(interactionContext)#uselib "NInput.dll"
#func global CreateInteractionContext "CreateInteractionContext" sptr
; CreateInteractionContext interactionContext ; 戻り値は stat
; interactionContext : HINTERACTIONCONTEXT* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "NInput.dll"
#cfunc global CreateInteractionContext "CreateInteractionContext" sptr
; res = CreateInteractionContext(interactionContext)
; interactionContext : HINTERACTIONCONTEXT* out -> "sptr"; HRESULT CreateInteractionContext(HINTERACTIONCONTEXT* interactionContext)
#uselib "NInput.dll"
#cfunc global CreateInteractionContext "CreateInteractionContext" intptr
; res = CreateInteractionContext(interactionContext)
; interactionContext : HINTERACTIONCONTEXT* out -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
ninput = windows.NewLazySystemDLL("NInput.dll")
procCreateInteractionContext = ninput.NewProc("CreateInteractionContext")
)
// interactionContext (HINTERACTIONCONTEXT* out)
r1, _, err := procCreateInteractionContext.Call(
uintptr(interactionContext),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction CreateInteractionContext(
interactionContext: Pointer // HINTERACTIONCONTEXT* out
): Integer; stdcall;
external 'NInput.dll' name 'CreateInteractionContext';result := DllCall("NInput\CreateInteractionContext"
, "Ptr", interactionContext ; HINTERACTIONCONTEXT* out
, "Int") ; return: HRESULT●CreateInteractionContext(interactionContext) = DLL("NInput.dll", "int CreateInteractionContext(void*)")
# 呼び出し: CreateInteractionContext(interactionContext)
# interactionContext : HINTERACTIONCONTEXT* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。