ホーム › UI.Input.Pointer › GetPointerTouchInfoHistory
GetPointerTouchInfoHistory
関数指定したポインタのタッチ入力情報の履歴を取得する。
シグネチャ
// USER32.dll
#include <windows.h>
BOOL GetPointerTouchInfoHistory(
DWORD pointerId,
DWORD* entriesCount,
POINTER_TOUCH_INFO* touchInfo // optional
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| pointerId | DWORD | in | 対象タッチポインタのIDを指定する。 |
| entriesCount | DWORD* | inout | 入力時は配列容量、出力時は取得履歴件数を表すDWORDへのポインタ。 |
| touchInfo | POINTER_TOUCH_INFO* | outoptional | タッチ情報の履歴を受け取るPOINTER_TOUCH_INFO配列へのポインタ。 |
戻り値の型: BOOL
各言語での呼び出し定義
// USER32.dll
#include <windows.h>
BOOL GetPointerTouchInfoHistory(
DWORD pointerId,
DWORD* entriesCount,
POINTER_TOUCH_INFO* touchInfo // optional
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("USER32.dll", SetLastError = true, ExactSpelling = true)]
static extern bool GetPointerTouchInfoHistory(
uint pointerId, // DWORD
ref uint entriesCount, // DWORD* in/out
IntPtr touchInfo // POINTER_TOUCH_INFO* optional, out
);<DllImport("USER32.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function GetPointerTouchInfoHistory(
pointerId As UInteger, ' DWORD
ByRef entriesCount As UInteger, ' DWORD* in/out
touchInfo As IntPtr ' POINTER_TOUCH_INFO* optional, out
) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function' pointerId : DWORD
' entriesCount : DWORD* in/out
' touchInfo : POINTER_TOUCH_INFO* optional, out
Declare PtrSafe Function GetPointerTouchInfoHistory Lib "user32" ( _
ByVal pointerId As Long, _
ByRef entriesCount As Long, _
ByVal touchInfo As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GetPointerTouchInfoHistory = ctypes.windll.user32.GetPointerTouchInfoHistory
GetPointerTouchInfoHistory.restype = wintypes.BOOL
GetPointerTouchInfoHistory.argtypes = [
wintypes.DWORD, # pointerId : DWORD
ctypes.POINTER(wintypes.DWORD), # entriesCount : DWORD* in/out
ctypes.c_void_p, # touchInfo : POINTER_TOUCH_INFO* optional, out
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('USER32.dll')
GetPointerTouchInfoHistory = Fiddle::Function.new(
lib['GetPointerTouchInfoHistory'],
[
-Fiddle::TYPE_INT, # pointerId : DWORD
Fiddle::TYPE_VOIDP, # entriesCount : DWORD* in/out
Fiddle::TYPE_VOIDP, # touchInfo : POINTER_TOUCH_INFO* optional, out
],
Fiddle::TYPE_INT)#[link(name = "user32")]
extern "system" {
fn GetPointerTouchInfoHistory(
pointerId: u32, // DWORD
entriesCount: *mut u32, // DWORD* in/out
touchInfo: *mut POINTER_TOUCH_INFO // POINTER_TOUCH_INFO* optional, out
) -> 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 GetPointerTouchInfoHistory(uint pointerId, ref uint entriesCount, IntPtr touchInfo);
"@
$api = Add-Type -MemberDefinition $sig -Name 'USER32_GetPointerTouchInfoHistory' -Namespace Win32 -PassThru
# $api::GetPointerTouchInfoHistory(pointerId, entriesCount, touchInfo)#uselib "USER32.dll"
#func global GetPointerTouchInfoHistory "GetPointerTouchInfoHistory" sptr, sptr, sptr
; GetPointerTouchInfoHistory pointerId, varptr(entriesCount), varptr(touchInfo) ; 戻り値は stat
; pointerId : DWORD -> "sptr"
; entriesCount : DWORD* in/out -> "sptr"
; touchInfo : POINTER_TOUCH_INFO* optional, out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "USER32.dll" #cfunc global GetPointerTouchInfoHistory "GetPointerTouchInfoHistory" int, var, var ; res = GetPointerTouchInfoHistory(pointerId, entriesCount, touchInfo) ; pointerId : DWORD -> "int" ; entriesCount : DWORD* in/out -> "var" ; touchInfo : POINTER_TOUCH_INFO* optional, out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "USER32.dll" #cfunc global GetPointerTouchInfoHistory "GetPointerTouchInfoHistory" int, sptr, sptr ; res = GetPointerTouchInfoHistory(pointerId, varptr(entriesCount), varptr(touchInfo)) ; pointerId : DWORD -> "int" ; entriesCount : DWORD* in/out -> "sptr" ; touchInfo : POINTER_TOUCH_INFO* optional, out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; BOOL GetPointerTouchInfoHistory(DWORD pointerId, DWORD* entriesCount, POINTER_TOUCH_INFO* touchInfo) #uselib "USER32.dll" #cfunc global GetPointerTouchInfoHistory "GetPointerTouchInfoHistory" int, var, var ; res = GetPointerTouchInfoHistory(pointerId, entriesCount, touchInfo) ; pointerId : DWORD -> "int" ; entriesCount : DWORD* in/out -> "var" ; touchInfo : POINTER_TOUCH_INFO* optional, out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; BOOL GetPointerTouchInfoHistory(DWORD pointerId, DWORD* entriesCount, POINTER_TOUCH_INFO* touchInfo) #uselib "USER32.dll" #cfunc global GetPointerTouchInfoHistory "GetPointerTouchInfoHistory" int, intptr, intptr ; res = GetPointerTouchInfoHistory(pointerId, varptr(entriesCount), varptr(touchInfo)) ; pointerId : DWORD -> "int" ; entriesCount : DWORD* in/out -> "intptr" ; touchInfo : POINTER_TOUCH_INFO* optional, out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
user32 = windows.NewLazySystemDLL("USER32.dll")
procGetPointerTouchInfoHistory = user32.NewProc("GetPointerTouchInfoHistory")
)
// pointerId (DWORD), entriesCount (DWORD* in/out), touchInfo (POINTER_TOUCH_INFO* optional, out)
r1, _, err := procGetPointerTouchInfoHistory.Call(
uintptr(pointerId),
uintptr(entriesCount),
uintptr(touchInfo),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction GetPointerTouchInfoHistory(
pointerId: DWORD; // DWORD
entriesCount: Pointer; // DWORD* in/out
touchInfo: Pointer // POINTER_TOUCH_INFO* optional, out
): BOOL; stdcall;
external 'USER32.dll' name 'GetPointerTouchInfoHistory';result := DllCall("USER32\GetPointerTouchInfoHistory"
, "UInt", pointerId ; DWORD
, "Ptr", entriesCount ; DWORD* in/out
, "Ptr", touchInfo ; POINTER_TOUCH_INFO* optional, out
, "Int") ; return: BOOL●GetPointerTouchInfoHistory(pointerId, entriesCount, touchInfo) = DLL("USER32.dll", "bool GetPointerTouchInfoHistory(dword, void*, void*)")
# 呼び出し: GetPointerTouchInfoHistory(pointerId, entriesCount, touchInfo)
# pointerId : DWORD -> "dword"
# entriesCount : DWORD* in/out -> "void*"
# touchInfo : POINTER_TOUCH_INFO* optional, out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "user32" fn GetPointerTouchInfoHistory(
pointerId: u32, // DWORD
entriesCount: [*c]u32, // DWORD* in/out
touchInfo: [*c]POINTER_TOUCH_INFO // POINTER_TOUCH_INFO* optional, out
) callconv(std.os.windows.WINAPI) i32;proc GetPointerTouchInfoHistory(
pointerId: uint32, # DWORD
entriesCount: ptr uint32, # DWORD* in/out
touchInfo: ptr POINTER_TOUCH_INFO # POINTER_TOUCH_INFO* optional, out
): int32 {.importc: "GetPointerTouchInfoHistory", stdcall, dynlib: "USER32.dll".}pragma(lib, "user32");
extern(Windows)
int GetPointerTouchInfoHistory(
uint pointerId, // DWORD
uint* entriesCount, // DWORD* in/out
POINTER_TOUCH_INFO* touchInfo // POINTER_TOUCH_INFO* optional, out
);ccall((:GetPointerTouchInfoHistory, "USER32.dll"), stdcall, Int32,
(UInt32, Ptr{UInt32}, Ptr{POINTER_TOUCH_INFO}),
pointerId, entriesCount, touchInfo)
# pointerId : DWORD -> UInt32
# entriesCount : DWORD* in/out -> Ptr{UInt32}
# touchInfo : POINTER_TOUCH_INFO* optional, out -> Ptr{POINTER_TOUCH_INFO}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t GetPointerTouchInfoHistory(
uint32_t pointerId,
uint32_t* entriesCount,
void* touchInfo);
]]
local user32 = ffi.load("user32")
-- user32.GetPointerTouchInfoHistory(pointerId, entriesCount, touchInfo)
-- pointerId : DWORD
-- entriesCount : DWORD* in/out
-- touchInfo : POINTER_TOUCH_INFO* optional, out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('USER32.dll');
const GetPointerTouchInfoHistory = lib.func('__stdcall', 'GetPointerTouchInfoHistory', 'int32_t', ['uint32_t', 'uint32_t *', 'void *']);
// GetPointerTouchInfoHistory(pointerId, entriesCount, touchInfo)
// pointerId : DWORD -> 'uint32_t'
// entriesCount : DWORD* in/out -> 'uint32_t *'
// touchInfo : POINTER_TOUCH_INFO* optional, out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("USER32.dll", {
GetPointerTouchInfoHistory: { parameters: ["u32", "pointer", "pointer"], result: "i32" },
});
// lib.symbols.GetPointerTouchInfoHistory(pointerId, entriesCount, touchInfo)
// pointerId : DWORD -> "u32"
// entriesCount : DWORD* in/out -> "pointer"
// touchInfo : POINTER_TOUCH_INFO* optional, out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t GetPointerTouchInfoHistory(
uint32_t pointerId,
uint32_t* entriesCount,
void* touchInfo);
C, "USER32.dll");
// $ffi->GetPointerTouchInfoHistory(pointerId, entriesCount, touchInfo);
// pointerId : DWORD
// entriesCount : DWORD* in/out
// touchInfo : POINTER_TOUCH_INFO* optional, out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface User32 extends StdCallLibrary {
User32 INSTANCE = Native.load("user32", User32.class);
boolean GetPointerTouchInfoHistory(
int pointerId, // DWORD
IntByReference entriesCount, // DWORD* in/out
Pointer touchInfo // POINTER_TOUCH_INFO* optional, out
);
}@[Link("user32")]
lib LibUSER32
fun GetPointerTouchInfoHistory = GetPointerTouchInfoHistory(
pointerId : UInt32, # DWORD
entriesCount : UInt32*, # DWORD* in/out
touchInfo : POINTER_TOUCH_INFO* # POINTER_TOUCH_INFO* optional, out
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef GetPointerTouchInfoHistoryNative = Int32 Function(Uint32, Pointer<Uint32>, Pointer<Void>);
typedef GetPointerTouchInfoHistoryDart = int Function(int, Pointer<Uint32>, Pointer<Void>);
final GetPointerTouchInfoHistory = DynamicLibrary.open('USER32.dll')
.lookupFunction<GetPointerTouchInfoHistoryNative, GetPointerTouchInfoHistoryDart>('GetPointerTouchInfoHistory');
// pointerId : DWORD -> Uint32
// entriesCount : DWORD* in/out -> Pointer<Uint32>
// touchInfo : POINTER_TOUCH_INFO* optional, out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function GetPointerTouchInfoHistory(
pointerId: DWORD; // DWORD
entriesCount: Pointer; // DWORD* in/out
touchInfo: Pointer // POINTER_TOUCH_INFO* optional, out
): BOOL; stdcall;
external 'USER32.dll' name 'GetPointerTouchInfoHistory';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "GetPointerTouchInfoHistory"
c_GetPointerTouchInfoHistory :: Word32 -> Ptr Word32 -> Ptr () -> IO CInt
-- pointerId : DWORD -> Word32
-- entriesCount : DWORD* in/out -> Ptr Word32
-- touchInfo : POINTER_TOUCH_INFO* optional, out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let getpointertouchinfohistory =
foreign "GetPointerTouchInfoHistory"
(uint32_t @-> (ptr uint32_t) @-> (ptr void) @-> returning int32_t)
(* pointerId : DWORD -> uint32_t *)
(* entriesCount : DWORD* in/out -> (ptr uint32_t) *)
(* touchInfo : POINTER_TOUCH_INFO* optional, out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library user32 (t "USER32.dll"))
(cffi:use-foreign-library user32)
(cffi:defcfun ("GetPointerTouchInfoHistory" get-pointer-touch-info-history :convention :stdcall) :int32
(pointer-id :uint32) ; DWORD
(entries-count :pointer) ; DWORD* in/out
(touch-info :pointer)) ; POINTER_TOUCH_INFO* optional, out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $GetPointerTouchInfoHistory = Win32::API::More->new('USER32',
'BOOL GetPointerTouchInfoHistory(DWORD pointerId, LPVOID entriesCount, LPVOID touchInfo)');
# my $ret = $GetPointerTouchInfoHistory->Call($pointerId, $entriesCount, $touchInfo);
# pointerId : DWORD -> DWORD
# entriesCount : DWORD* in/out -> LPVOID
# touchInfo : POINTER_TOUCH_INFO* optional, out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
使用する型