Win32 API 日本語リファレンス
ホームUI.Input.Touch › CloseTouchInputHandle

CloseTouchInputHandle

関数
タッチ入力ハンドルを閉じ関連リソースを解放する。
DLLUSER32.dll呼出規約winapiSetLastErrorあり対応OSWindows 7 以降

シグネチャ

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

BOOL CloseTouchInputHandle(
    HTOUCHINPUT hTouchInput
);

パラメーター

名前方向
hTouchInputHTOUCHINPUTin

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL CloseTouchInputHandle(
    HTOUCHINPUT hTouchInput
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("USER32.dll", SetLastError = true, ExactSpelling = true)]
static extern bool CloseTouchInputHandle(
    IntPtr hTouchInput   // HTOUCHINPUT
);
<DllImport("USER32.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function CloseTouchInputHandle(
    hTouchInput As IntPtr   ' HTOUCHINPUT
) As Boolean
End Function
' hTouchInput : HTOUCHINPUT
Declare PtrSafe Function CloseTouchInputHandle Lib "user32" ( _
    ByVal hTouchInput As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

CloseTouchInputHandle = ctypes.windll.user32.CloseTouchInputHandle
CloseTouchInputHandle.restype = wintypes.BOOL
CloseTouchInputHandle.argtypes = [
    wintypes.HANDLE,  # hTouchInput : HTOUCHINPUT
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('USER32.dll')
CloseTouchInputHandle = Fiddle::Function.new(
  lib['CloseTouchInputHandle'],
  [
    Fiddle::TYPE_VOIDP,  # hTouchInput : HTOUCHINPUT
  ],
  Fiddle::TYPE_INT)
#[link(name = "user32")]
extern "system" {
    fn CloseTouchInputHandle(
        hTouchInput: *mut core::ffi::c_void  // HTOUCHINPUT
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("USER32.dll", SetLastError = true)]
public static extern bool CloseTouchInputHandle(IntPtr hTouchInput);
"@
$api = Add-Type -MemberDefinition $sig -Name 'USER32_CloseTouchInputHandle' -Namespace Win32 -PassThru
# $api::CloseTouchInputHandle(hTouchInput)
#uselib "USER32.dll"
#func global CloseTouchInputHandle "CloseTouchInputHandle" sptr
; CloseTouchInputHandle hTouchInput   ; 戻り値は stat
; hTouchInput : HTOUCHINPUT -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "USER32.dll"
#cfunc global CloseTouchInputHandle "CloseTouchInputHandle" sptr
; res = CloseTouchInputHandle(hTouchInput)
; hTouchInput : HTOUCHINPUT -> "sptr"
; BOOL CloseTouchInputHandle(HTOUCHINPUT hTouchInput)
#uselib "USER32.dll"
#cfunc global CloseTouchInputHandle "CloseTouchInputHandle" intptr
; res = CloseTouchInputHandle(hTouchInput)
; hTouchInput : HTOUCHINPUT -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	user32 = windows.NewLazySystemDLL("USER32.dll")
	procCloseTouchInputHandle = user32.NewProc("CloseTouchInputHandle")
)

// hTouchInput (HTOUCHINPUT)
r1, _, err := procCloseTouchInputHandle.Call(
	uintptr(hTouchInput),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function CloseTouchInputHandle(
  hTouchInput: THandle   // HTOUCHINPUT
): BOOL; stdcall;
  external 'USER32.dll' name 'CloseTouchInputHandle';
result := DllCall("USER32\CloseTouchInputHandle"
    , "Ptr", hTouchInput   ; HTOUCHINPUT
    , "Int")   ; return: BOOL
●CloseTouchInputHandle(hTouchInput) = DLL("USER32.dll", "bool CloseTouchInputHandle(void*)")
# 呼び出し: CloseTouchInputHandle(hTouchInput)
# hTouchInput : HTOUCHINPUT -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。