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

GESTUREINFO

構造体
サイズx64: 56 バイト / x86: 48 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
cbSizeDWORD4+0+0この構造体のバイトサイズ。呼び出し前に設定する必要がある。
dwFlagsDWORD4+4+4ジェスチャの状態フラグ。開始・実行中・終了等を示す。
dwIDDWORD4+8+8ジェスチャの種別ID。ズーム・パン・回転・タップ等を示す。
hwndTargetHWND8/4+16+12ジェスチャの対象ウィンドウのハンドル。
ptsLocationPOINTS4+24+16ジェスチャが発生した画面座標(POINTS)。
dwInstanceIDDWORD4+28+20ジェスチャインスタンスの内部識別子。
dwSequenceIDDWORD4+32+24ジェスチャシーケンスの識別子。連続操作の関連付けに用いる。
ullArgumentsULONGLONG8+40+32ジェスチャ種別固有の引数(8バイト)。ズーム距離や回転角等を保持する。
cbExtraArgsDWORD4+48+40追加引数領域のバイトサイズ。

各言語での定義

#include <windows.h>

// POINTS  (x64 4 / x86 4 バイト)
typedef struct POINTS {
    SHORT x;
    SHORT y;
} POINTS;

// GESTUREINFO  (x64 56 / x86 48 バイト)
typedef struct GESTUREINFO {
    DWORD cbSize;
    DWORD dwFlags;
    DWORD dwID;
    HWND hwndTarget;
    POINTS ptsLocation;
    DWORD dwInstanceID;
    DWORD dwSequenceID;
    ULONGLONG ullArguments;
    DWORD cbExtraArgs;
} GESTUREINFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct POINTS
{
    public short x;
    public short y;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GESTUREINFO
{
    public uint cbSize;
    public uint dwFlags;
    public uint dwID;
    public IntPtr hwndTarget;
    public POINTS ptsLocation;
    public uint dwInstanceID;
    public uint dwSequenceID;
    public ulong ullArguments;
    public uint cbExtraArgs;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure POINTS
    Public x As Short
    Public y As Short
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GESTUREINFO
    Public cbSize As UInteger
    Public dwFlags As UInteger
    Public dwID As UInteger
    Public hwndTarget As IntPtr
    Public ptsLocation As POINTS
    Public dwInstanceID As UInteger
    Public dwSequenceID As UInteger
    Public ullArguments As ULong
    Public cbExtraArgs As UInteger
End Structure
import ctypes
from ctypes import wintypes

class POINTS(ctypes.Structure):
    _fields_ = [
        ("x", ctypes.c_short),
        ("y", ctypes.c_short),
    ]

class GESTUREINFO(ctypes.Structure):
    _fields_ = [
        ("cbSize", wintypes.DWORD),
        ("dwFlags", wintypes.DWORD),
        ("dwID", wintypes.DWORD),
        ("hwndTarget", ctypes.c_void_p),
        ("ptsLocation", POINTS),
        ("dwInstanceID", wintypes.DWORD),
        ("dwSequenceID", wintypes.DWORD),
        ("ullArguments", ctypes.c_ulonglong),
        ("cbExtraArgs", wintypes.DWORD),
    ]
#[repr(C)]
pub struct POINTS {
    pub x: i16,
    pub y: i16,
}

#[repr(C)]
pub struct GESTUREINFO {
    pub cbSize: u32,
    pub dwFlags: u32,
    pub dwID: u32,
    pub hwndTarget: *mut core::ffi::c_void,
    pub ptsLocation: POINTS,
    pub dwInstanceID: u32,
    pub dwSequenceID: u32,
    pub ullArguments: u64,
    pub cbExtraArgs: u32,
}
import "golang.org/x/sys/windows"

type POINTS struct {
	x int16
	y int16
}

type GESTUREINFO struct {
	cbSize uint32
	dwFlags uint32
	dwID uint32
	hwndTarget uintptr
	ptsLocation POINTS
	dwInstanceID uint32
	dwSequenceID uint32
	ullArguments uint64
	cbExtraArgs uint32
}
type
  POINTS = record
    x: Smallint;
    y: Smallint;
  end;

  GESTUREINFO = record
    cbSize: DWORD;
    dwFlags: DWORD;
    dwID: DWORD;
    hwndTarget: Pointer;
    ptsLocation: POINTS;
    dwInstanceID: DWORD;
    dwSequenceID: DWORD;
    ullArguments: UInt64;
    cbExtraArgs: DWORD;
  end;
const POINTS = extern struct {
    x: i16,
    y: i16,
};

const GESTUREINFO = extern struct {
    cbSize: u32,
    dwFlags: u32,
    dwID: u32,
    hwndTarget: ?*anyopaque,
    ptsLocation: POINTS,
    dwInstanceID: u32,
    dwSequenceID: u32,
    ullArguments: u64,
    cbExtraArgs: u32,
};
type
  POINTS {.bycopy.} = object
    x: int16
    y: int16

  GESTUREINFO {.bycopy.} = object
    cbSize: uint32
    dwFlags: uint32
    dwID: uint32
    hwndTarget: pointer
    ptsLocation: POINTS
    dwInstanceID: uint32
    dwSequenceID: uint32
    ullArguments: uint64
    cbExtraArgs: uint32
struct POINTS
{
    short x;
    short y;
}

struct GESTUREINFO
{
    uint cbSize;
    uint dwFlags;
    uint dwID;
    void* hwndTarget;
    POINTS ptsLocation;
    uint dwInstanceID;
    uint dwSequenceID;
    ulong ullArguments;
    uint cbExtraArgs;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; GESTUREINFO サイズ: 48 バイト(x86)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwID : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; hwndTarget : HWND (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ptsLocation : POINTS (+16, 4byte)  varptr(st)+16 を基点に操作(4byte:入れ子/配列)
; dwInstanceID : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; dwSequenceID : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ullArguments : ULONGLONG (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; cbExtraArgs : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GESTUREINFO サイズ: 56 バイト(x64)
dim st, 14    ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwID : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; hwndTarget : HWND (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; ptsLocation : POINTS (+24, 4byte)  varptr(st)+24 を基点に操作(4byte:入れ子/配列)
; dwInstanceID : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; dwSequenceID : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; ullArguments : ULONGLONG (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; cbExtraArgs : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global POINTS
    #field short x
    #field short y
#endstruct

#defstruct global GESTUREINFO
    #field int cbSize
    #field int dwFlags
    #field int dwID
    #field intptr hwndTarget
    #field POINTS ptsLocation
    #field int dwInstanceID
    #field int dwSequenceID
    #field int64 ullArguments
    #field int cbExtraArgs
#endstruct

stdim st, GESTUREINFO        ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize