GetMouseMovePointsEx
関数シグネチャ
// USER32.dll
#include <windows.h>
INT GetMouseMovePointsEx(
DWORD cbSize,
MOUSEMOVEPOINT* lppt,
MOUSEMOVEPOINT* lpptBuf,
INT nBufPoints,
GET_MOUSE_MOVE_POINTS_EX_RESOLUTION resolution
);パラメーター
| 名前 | 型 | 方向 | 説明 | ||||||
|---|---|---|---|---|---|---|---|---|---|
| cbSize | DWORD | in | MOUSEMOVEPOINT 構造体のサイズ(バイト単位)。 | ||||||
| lppt | MOUSEMOVEPOINT* | in | 有効なマウス座標(スクリーン座標)を格納した MOUSEMOVEPOINT 構造体へのポインター。タイムスタンプを含めることもできます。 GetMouseMovePointsEx 関数は、マウス座標の履歴からこの点を検索します。点が見つかった場合、指定された点を含め、その点以前の直近 nBufPoints 件を返します。 アプリケーションがタイムスタンプを指定した場合、GetMouseMovePointsEx 関数はそれを利用して、異なる時刻に記録された同一の 2 点を区別します。 アプリケーションは、WM_MOUSEMOVE メッセージから受け取ったマウス座標を使用してこの関数を呼び出し、それらをスクリーン座標に変換する必要があります。 | ||||||
| lpptBuf | MOUSEMOVEPOINT* | out | 点を受け取るバッファーへのポインター。サイズは少なくとも cbSize* nBufPoints 以上である必要があります。 | ||||||
| nBufPoints | INT | in | 取得する点の数。 | ||||||
| resolution | GET_MOUSE_MOVE_POINTS_EX_RESOLUTION | in | 希望する解像度。このパラメーターには次のいずれかの値を指定できます。
|
戻り値の型: INT
公式ドキュメント
マウスまたはペンの直近の座標を最大 64 件まで取得します。
戻り値
型: int
関数が成功した場合、戻り値はバッファー内の点の数です。失敗した場合は –1 を返します。拡張エラー情報を取得するには、アプリケーションから GetLastError を呼び出します。
解説(Remarks)
システムは直近 64 件のマウス座標とそのタイムスタンプを保持します。アプリケーションが GetMouseMovePointsEx にマウス座標を渡し、その座標がシステムのマウス座標履歴に存在する場合、この関数はシステムの履歴から指定された数の座標を取得します。タイムスタンプを指定することもでき、これは履歴内の同一の点を区別するために使用されます。
GetMouseMovePointsEx 関数は、最終的に呼び出し元スレッドだけでなく他のスレッドにもディスパッチされた点を返します。
GetMouseMovePointsEx は、次の場合に失敗するか、誤った値を返すことがあります。
- MOUSEMOVEPOINT 構造体に負の座標が渡された場合。
- GetMouseMovePointsEx が負の値を持つ座標を取得した場合。
int nVirtualWidth = GetSystemMetrics(SM_CXVIRTUALSCREEN) ;
int nVirtualHeight = GetSystemMetrics(SM_CYVIRTUALSCREEN) ;
int nVirtualLeft = GetSystemMetrics(SM_XVIRTUALSCREEN) ;
int nVirtualTop = GetSystemMetrics(SM_YVIRTUALSCREEN) ;
int cpt = 0 ;
int mode = GMMP_USE_DISPLAY_POINTS ;
MOUSEMOVEPOINT mp_in ;
MOUSEMOVEPOINT mp_out[64] ;
ZeroMemory(&mp_in, sizeof(mp_in)) ;
mp_in.x = pt.x & 0x0000FFFF ;//Ensure that this number will pass through.
mp_in.y = pt.y & 0x0000FFFF ;
cpt = GetMouseMovePointsEx(&mp_in, &mp_out, 64, mode) ;
for (int i = 0; i < cpt; i++)
{
switch(mode)
{
case GMMP_USE_DISPLAY_POINTS:
if (mp_out[i].x > 32767)
mp_out[i].x -= 65536 ;
if (mp_out[i].y > 32767)
mp_out[i].y -= 65536 ;
break ;
case GMMP_USE_HIGH_RESOLUTION_POINTS:
mp_out[i].x = ((mp_out[i].x * (nVirtualWidth - 1)) - (nVirtualLeft * 65536)) / nVirtualWidth ;
mp_out[i].y = ((mp_out[i].y * (nVirtualHeight - 1)) - (nVirtualTop * 65536)) / nVirtualHeight ;
break ;
}
}
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での呼び出し定義
// USER32.dll
#include <windows.h>
INT GetMouseMovePointsEx(
DWORD cbSize,
MOUSEMOVEPOINT* lppt,
MOUSEMOVEPOINT* lpptBuf,
INT nBufPoints,
GET_MOUSE_MOVE_POINTS_EX_RESOLUTION resolution
);[DllImport("USER32.dll", SetLastError = true, ExactSpelling = true)]
static extern int GetMouseMovePointsEx(
uint cbSize, // DWORD
IntPtr lppt, // MOUSEMOVEPOINT*
IntPtr lpptBuf, // MOUSEMOVEPOINT* out
int nBufPoints, // INT
uint resolution // GET_MOUSE_MOVE_POINTS_EX_RESOLUTION
);<DllImport("USER32.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function GetMouseMovePointsEx(
cbSize As UInteger, ' DWORD
lppt As IntPtr, ' MOUSEMOVEPOINT*
lpptBuf As IntPtr, ' MOUSEMOVEPOINT* out
nBufPoints As Integer, ' INT
resolution As UInteger ' GET_MOUSE_MOVE_POINTS_EX_RESOLUTION
) As Integer
End Function' cbSize : DWORD
' lppt : MOUSEMOVEPOINT*
' lpptBuf : MOUSEMOVEPOINT* out
' nBufPoints : INT
' resolution : GET_MOUSE_MOVE_POINTS_EX_RESOLUTION
Declare PtrSafe Function GetMouseMovePointsEx Lib "user32" ( _
ByVal cbSize As Long, _
ByVal lppt As LongPtr, _
ByVal lpptBuf As LongPtr, _
ByVal nBufPoints As Long, _
ByVal resolution As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GetMouseMovePointsEx = ctypes.windll.user32.GetMouseMovePointsEx
GetMouseMovePointsEx.restype = ctypes.c_int
GetMouseMovePointsEx.argtypes = [
wintypes.DWORD, # cbSize : DWORD
ctypes.c_void_p, # lppt : MOUSEMOVEPOINT*
ctypes.c_void_p, # lpptBuf : MOUSEMOVEPOINT* out
ctypes.c_int, # nBufPoints : INT
wintypes.DWORD, # resolution : GET_MOUSE_MOVE_POINTS_EX_RESOLUTION
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('USER32.dll')
GetMouseMovePointsEx = Fiddle::Function.new(
lib['GetMouseMovePointsEx'],
[
-Fiddle::TYPE_INT, # cbSize : DWORD
Fiddle::TYPE_VOIDP, # lppt : MOUSEMOVEPOINT*
Fiddle::TYPE_VOIDP, # lpptBuf : MOUSEMOVEPOINT* out
Fiddle::TYPE_INT, # nBufPoints : INT
-Fiddle::TYPE_INT, # resolution : GET_MOUSE_MOVE_POINTS_EX_RESOLUTION
],
Fiddle::TYPE_INT)#[link(name = "user32")]
extern "system" {
fn GetMouseMovePointsEx(
cbSize: u32, // DWORD
lppt: *mut MOUSEMOVEPOINT, // MOUSEMOVEPOINT*
lpptBuf: *mut MOUSEMOVEPOINT, // MOUSEMOVEPOINT* out
nBufPoints: i32, // INT
resolution: u32 // GET_MOUSE_MOVE_POINTS_EX_RESOLUTION
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("USER32.dll", SetLastError = true)]
public static extern int GetMouseMovePointsEx(uint cbSize, IntPtr lppt, IntPtr lpptBuf, int nBufPoints, uint resolution);
"@
$api = Add-Type -MemberDefinition $sig -Name 'USER32_GetMouseMovePointsEx' -Namespace Win32 -PassThru
# $api::GetMouseMovePointsEx(cbSize, lppt, lpptBuf, nBufPoints, resolution)#uselib "USER32.dll"
#func global GetMouseMovePointsEx "GetMouseMovePointsEx" sptr, sptr, sptr, sptr, sptr
; GetMouseMovePointsEx cbSize, varptr(lppt), varptr(lpptBuf), nBufPoints, resolution ; 戻り値は stat
; cbSize : DWORD -> "sptr"
; lppt : MOUSEMOVEPOINT* -> "sptr"
; lpptBuf : MOUSEMOVEPOINT* out -> "sptr"
; nBufPoints : INT -> "sptr"
; resolution : GET_MOUSE_MOVE_POINTS_EX_RESOLUTION -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "USER32.dll" #cfunc global GetMouseMovePointsEx "GetMouseMovePointsEx" int, var, var, int, int ; res = GetMouseMovePointsEx(cbSize, lppt, lpptBuf, nBufPoints, resolution) ; cbSize : DWORD -> "int" ; lppt : MOUSEMOVEPOINT* -> "var" ; lpptBuf : MOUSEMOVEPOINT* out -> "var" ; nBufPoints : INT -> "int" ; resolution : GET_MOUSE_MOVE_POINTS_EX_RESOLUTION -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "USER32.dll" #cfunc global GetMouseMovePointsEx "GetMouseMovePointsEx" int, sptr, sptr, int, int ; res = GetMouseMovePointsEx(cbSize, varptr(lppt), varptr(lpptBuf), nBufPoints, resolution) ; cbSize : DWORD -> "int" ; lppt : MOUSEMOVEPOINT* -> "sptr" ; lpptBuf : MOUSEMOVEPOINT* out -> "sptr" ; nBufPoints : INT -> "int" ; resolution : GET_MOUSE_MOVE_POINTS_EX_RESOLUTION -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
; INT GetMouseMovePointsEx(DWORD cbSize, MOUSEMOVEPOINT* lppt, MOUSEMOVEPOINT* lpptBuf, INT nBufPoints, GET_MOUSE_MOVE_POINTS_EX_RESOLUTION resolution) #uselib "USER32.dll" #cfunc global GetMouseMovePointsEx "GetMouseMovePointsEx" int, var, var, int, int ; res = GetMouseMovePointsEx(cbSize, lppt, lpptBuf, nBufPoints, resolution) ; cbSize : DWORD -> "int" ; lppt : MOUSEMOVEPOINT* -> "var" ; lpptBuf : MOUSEMOVEPOINT* out -> "var" ; nBufPoints : INT -> "int" ; resolution : GET_MOUSE_MOVE_POINTS_EX_RESOLUTION -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; INT GetMouseMovePointsEx(DWORD cbSize, MOUSEMOVEPOINT* lppt, MOUSEMOVEPOINT* lpptBuf, INT nBufPoints, GET_MOUSE_MOVE_POINTS_EX_RESOLUTION resolution) #uselib "USER32.dll" #cfunc global GetMouseMovePointsEx "GetMouseMovePointsEx" int, intptr, intptr, int, int ; res = GetMouseMovePointsEx(cbSize, varptr(lppt), varptr(lpptBuf), nBufPoints, resolution) ; cbSize : DWORD -> "int" ; lppt : MOUSEMOVEPOINT* -> "intptr" ; lpptBuf : MOUSEMOVEPOINT* out -> "intptr" ; nBufPoints : INT -> "int" ; resolution : GET_MOUSE_MOVE_POINTS_EX_RESOLUTION -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
user32 = windows.NewLazySystemDLL("USER32.dll")
procGetMouseMovePointsEx = user32.NewProc("GetMouseMovePointsEx")
)
// cbSize (DWORD), lppt (MOUSEMOVEPOINT*), lpptBuf (MOUSEMOVEPOINT* out), nBufPoints (INT), resolution (GET_MOUSE_MOVE_POINTS_EX_RESOLUTION)
r1, _, err := procGetMouseMovePointsEx.Call(
uintptr(cbSize),
uintptr(lppt),
uintptr(lpptBuf),
uintptr(nBufPoints),
uintptr(resolution),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction GetMouseMovePointsEx(
cbSize: DWORD; // DWORD
lppt: Pointer; // MOUSEMOVEPOINT*
lpptBuf: Pointer; // MOUSEMOVEPOINT* out
nBufPoints: Integer; // INT
resolution: DWORD // GET_MOUSE_MOVE_POINTS_EX_RESOLUTION
): Integer; stdcall;
external 'USER32.dll' name 'GetMouseMovePointsEx';result := DllCall("USER32\GetMouseMovePointsEx"
, "UInt", cbSize ; DWORD
, "Ptr", lppt ; MOUSEMOVEPOINT*
, "Ptr", lpptBuf ; MOUSEMOVEPOINT* out
, "Int", nBufPoints ; INT
, "UInt", resolution ; GET_MOUSE_MOVE_POINTS_EX_RESOLUTION
, "Int") ; return: INT●GetMouseMovePointsEx(cbSize, lppt, lpptBuf, nBufPoints, resolution) = DLL("USER32.dll", "int GetMouseMovePointsEx(dword, void*, void*, int, dword)")
# 呼び出し: GetMouseMovePointsEx(cbSize, lppt, lpptBuf, nBufPoints, resolution)
# cbSize : DWORD -> "dword"
# lppt : MOUSEMOVEPOINT* -> "void*"
# lpptBuf : MOUSEMOVEPOINT* out -> "void*"
# nBufPoints : INT -> "int"
# resolution : GET_MOUSE_MOVE_POINTS_EX_RESOLUTION -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "user32" fn GetMouseMovePointsEx(
cbSize: u32, // DWORD
lppt: [*c]MOUSEMOVEPOINT, // MOUSEMOVEPOINT*
lpptBuf: [*c]MOUSEMOVEPOINT, // MOUSEMOVEPOINT* out
nBufPoints: i32, // INT
resolution: u32 // GET_MOUSE_MOVE_POINTS_EX_RESOLUTION
) callconv(std.os.windows.WINAPI) i32;proc GetMouseMovePointsEx(
cbSize: uint32, # DWORD
lppt: ptr MOUSEMOVEPOINT, # MOUSEMOVEPOINT*
lpptBuf: ptr MOUSEMOVEPOINT, # MOUSEMOVEPOINT* out
nBufPoints: int32, # INT
resolution: uint32 # GET_MOUSE_MOVE_POINTS_EX_RESOLUTION
): int32 {.importc: "GetMouseMovePointsEx", stdcall, dynlib: "USER32.dll".}pragma(lib, "user32");
extern(Windows)
int GetMouseMovePointsEx(
uint cbSize, // DWORD
MOUSEMOVEPOINT* lppt, // MOUSEMOVEPOINT*
MOUSEMOVEPOINT* lpptBuf, // MOUSEMOVEPOINT* out
int nBufPoints, // INT
uint resolution // GET_MOUSE_MOVE_POINTS_EX_RESOLUTION
);ccall((:GetMouseMovePointsEx, "USER32.dll"), stdcall, Int32,
(UInt32, Ptr{MOUSEMOVEPOINT}, Ptr{MOUSEMOVEPOINT}, Int32, UInt32),
cbSize, lppt, lpptBuf, nBufPoints, resolution)
# cbSize : DWORD -> UInt32
# lppt : MOUSEMOVEPOINT* -> Ptr{MOUSEMOVEPOINT}
# lpptBuf : MOUSEMOVEPOINT* out -> Ptr{MOUSEMOVEPOINT}
# nBufPoints : INT -> Int32
# resolution : GET_MOUSE_MOVE_POINTS_EX_RESOLUTION -> UInt32
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t GetMouseMovePointsEx(
uint32_t cbSize,
void* lppt,
void* lpptBuf,
int32_t nBufPoints,
uint32_t resolution);
]]
local user32 = ffi.load("user32")
-- user32.GetMouseMovePointsEx(cbSize, lppt, lpptBuf, nBufPoints, resolution)
-- cbSize : DWORD
-- lppt : MOUSEMOVEPOINT*
-- lpptBuf : MOUSEMOVEPOINT* out
-- nBufPoints : INT
-- resolution : GET_MOUSE_MOVE_POINTS_EX_RESOLUTION
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('USER32.dll');
const GetMouseMovePointsEx = lib.func('__stdcall', 'GetMouseMovePointsEx', 'int32_t', ['uint32_t', 'void *', 'void *', 'int32_t', 'uint32_t']);
// GetMouseMovePointsEx(cbSize, lppt, lpptBuf, nBufPoints, resolution)
// cbSize : DWORD -> 'uint32_t'
// lppt : MOUSEMOVEPOINT* -> 'void *'
// lpptBuf : MOUSEMOVEPOINT* out -> 'void *'
// nBufPoints : INT -> 'int32_t'
// resolution : GET_MOUSE_MOVE_POINTS_EX_RESOLUTION -> 'uint32_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("USER32.dll", {
GetMouseMovePointsEx: { parameters: ["u32", "pointer", "pointer", "i32", "u32"], result: "i32" },
});
// lib.symbols.GetMouseMovePointsEx(cbSize, lppt, lpptBuf, nBufPoints, resolution)
// cbSize : DWORD -> "u32"
// lppt : MOUSEMOVEPOINT* -> "pointer"
// lpptBuf : MOUSEMOVEPOINT* out -> "pointer"
// nBufPoints : INT -> "i32"
// resolution : GET_MOUSE_MOVE_POINTS_EX_RESOLUTION -> "u32"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t GetMouseMovePointsEx(
uint32_t cbSize,
void* lppt,
void* lpptBuf,
int32_t nBufPoints,
uint32_t resolution);
C, "USER32.dll");
// $ffi->GetMouseMovePointsEx(cbSize, lppt, lpptBuf, nBufPoints, resolution);
// cbSize : DWORD
// lppt : MOUSEMOVEPOINT*
// lpptBuf : MOUSEMOVEPOINT* out
// nBufPoints : INT
// resolution : GET_MOUSE_MOVE_POINTS_EX_RESOLUTION
// 構造体/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);
int GetMouseMovePointsEx(
int cbSize, // DWORD
Pointer lppt, // MOUSEMOVEPOINT*
Pointer lpptBuf, // MOUSEMOVEPOINT* out
int nBufPoints, // INT
int resolution // GET_MOUSE_MOVE_POINTS_EX_RESOLUTION
);
}@[Link("user32")]
lib LibUSER32
fun GetMouseMovePointsEx = GetMouseMovePointsEx(
cbSize : UInt32, # DWORD
lppt : MOUSEMOVEPOINT*, # MOUSEMOVEPOINT*
lpptBuf : MOUSEMOVEPOINT*, # MOUSEMOVEPOINT* out
nBufPoints : Int32, # INT
resolution : UInt32 # GET_MOUSE_MOVE_POINTS_EX_RESOLUTION
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef GetMouseMovePointsExNative = Int32 Function(Uint32, Pointer<Void>, Pointer<Void>, Int32, Uint32);
typedef GetMouseMovePointsExDart = int Function(int, Pointer<Void>, Pointer<Void>, int, int);
final GetMouseMovePointsEx = DynamicLibrary.open('USER32.dll')
.lookupFunction<GetMouseMovePointsExNative, GetMouseMovePointsExDart>('GetMouseMovePointsEx');
// cbSize : DWORD -> Uint32
// lppt : MOUSEMOVEPOINT* -> Pointer<Void>
// lpptBuf : MOUSEMOVEPOINT* out -> Pointer<Void>
// nBufPoints : INT -> Int32
// resolution : GET_MOUSE_MOVE_POINTS_EX_RESOLUTION -> Uint32
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function GetMouseMovePointsEx(
cbSize: DWORD; // DWORD
lppt: Pointer; // MOUSEMOVEPOINT*
lpptBuf: Pointer; // MOUSEMOVEPOINT* out
nBufPoints: Integer; // INT
resolution: DWORD // GET_MOUSE_MOVE_POINTS_EX_RESOLUTION
): Integer; stdcall;
external 'USER32.dll' name 'GetMouseMovePointsEx';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "GetMouseMovePointsEx"
c_GetMouseMovePointsEx :: Word32 -> Ptr () -> Ptr () -> Int32 -> Word32 -> IO Int32
-- cbSize : DWORD -> Word32
-- lppt : MOUSEMOVEPOINT* -> Ptr ()
-- lpptBuf : MOUSEMOVEPOINT* out -> Ptr ()
-- nBufPoints : INT -> Int32
-- resolution : GET_MOUSE_MOVE_POINTS_EX_RESOLUTION -> Word32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let getmousemovepointsex =
foreign "GetMouseMovePointsEx"
(uint32_t @-> (ptr void) @-> (ptr void) @-> int32_t @-> uint32_t @-> returning int32_t)
(* cbSize : DWORD -> uint32_t *)
(* lppt : MOUSEMOVEPOINT* -> (ptr void) *)
(* lpptBuf : MOUSEMOVEPOINT* out -> (ptr void) *)
(* nBufPoints : INT -> int32_t *)
(* resolution : GET_MOUSE_MOVE_POINTS_EX_RESOLUTION -> uint32_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library user32 (t "USER32.dll"))
(cffi:use-foreign-library user32)
(cffi:defcfun ("GetMouseMovePointsEx" get-mouse-move-points-ex :convention :stdcall) :int32
(cb-size :uint32) ; DWORD
(lppt :pointer) ; MOUSEMOVEPOINT*
(lppt-buf :pointer) ; MOUSEMOVEPOINT* out
(n-buf-points :int32) ; INT
(resolution :uint32)) ; GET_MOUSE_MOVE_POINTS_EX_RESOLUTION
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $GetMouseMovePointsEx = Win32::API::More->new('USER32',
'int GetMouseMovePointsEx(DWORD cbSize, LPVOID lppt, LPVOID lpptBuf, int nBufPoints, DWORD resolution)');
# my $ret = $GetMouseMovePointsEx->Call($cbSize, $lppt, $lpptBuf, $nBufPoints, $resolution);
# cbSize : DWORD -> DWORD
# lppt : MOUSEMOVEPOINT* -> LPVOID
# lpptBuf : MOUSEMOVEPOINT* out -> LPVOID
# nBufPoints : INT -> int
# resolution : GET_MOUSE_MOVE_POINTS_EX_RESOLUTION -> DWORD
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。