ホーム › UI.Input.Touch › GESTURENOTIFYSTRUCT
GESTURENOTIFYSTRUCT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | 構造体のサイズです。 |
| dwFlags | DWORD | 4 | +4 | +4 | 将来の使用のために予約済みです。 |
| hwndTarget | HWND | 8/4 | +8 | +8 | ジェスチャ通知の対象となるウィンドウです。 |
| ptsLocation | POINTS | 4 | +16 | +12 | 物理的な画面座標で表したジェスチャの位置です。 |
| dwInstanceID | DWORD | 4 | +20 | +16 | GID_START で始まり GID_END で終わるジェスチャメッセージ群に対応する、特定のジェスチャインスタンスです。 |
公式ドキュメント
WM_GESTURENOTIFY メッセージとともに送信され、ジェスチャに関する情報を渡します。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// POINTS (x64 4 / x86 4 バイト)
typedef struct POINTS {
SHORT x;
SHORT y;
} POINTS;
// GESTURENOTIFYSTRUCT (x64 24 / x86 20 バイト)
typedef struct GESTURENOTIFYSTRUCT {
DWORD cbSize;
DWORD dwFlags;
HWND hwndTarget;
POINTS ptsLocation;
DWORD dwInstanceID;
} GESTURENOTIFYSTRUCT;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 GESTURENOTIFYSTRUCT
{
public uint cbSize;
public uint dwFlags;
public IntPtr hwndTarget;
public POINTS ptsLocation;
public uint dwInstanceID;
}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 GESTURENOTIFYSTRUCT
Public cbSize As UInteger
Public dwFlags As UInteger
Public hwndTarget As IntPtr
Public ptsLocation As POINTS
Public dwInstanceID As UInteger
End Structureimport ctypes
from ctypes import wintypes
class POINTS(ctypes.Structure):
_fields_ = [
("x", ctypes.c_short),
("y", ctypes.c_short),
]
class GESTURENOTIFYSTRUCT(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("dwFlags", wintypes.DWORD),
("hwndTarget", ctypes.c_void_p),
("ptsLocation", POINTS),
("dwInstanceID", wintypes.DWORD),
]#[repr(C)]
pub struct POINTS {
pub x: i16,
pub y: i16,
}
#[repr(C)]
pub struct GESTURENOTIFYSTRUCT {
pub cbSize: u32,
pub dwFlags: u32,
pub hwndTarget: *mut core::ffi::c_void,
pub ptsLocation: POINTS,
pub dwInstanceID: u32,
}import "golang.org/x/sys/windows"
type POINTS struct {
x int16
y int16
}
type GESTURENOTIFYSTRUCT struct {
cbSize uint32
dwFlags uint32
hwndTarget uintptr
ptsLocation POINTS
dwInstanceID uint32
}type
POINTS = record
x: Smallint;
y: Smallint;
end;
GESTURENOTIFYSTRUCT = record
cbSize: DWORD;
dwFlags: DWORD;
hwndTarget: Pointer;
ptsLocation: POINTS;
dwInstanceID: DWORD;
end;const POINTS = extern struct {
x: i16,
y: i16,
};
const GESTURENOTIFYSTRUCT = extern struct {
cbSize: u32,
dwFlags: u32,
hwndTarget: ?*anyopaque,
ptsLocation: POINTS,
dwInstanceID: u32,
};type
POINTS {.bycopy.} = object
x: int16
y: int16
GESTURENOTIFYSTRUCT {.bycopy.} = object
cbSize: uint32
dwFlags: uint32
hwndTarget: pointer
ptsLocation: POINTS
dwInstanceID: uint32struct POINTS
{
short x;
short y;
}
struct GESTURENOTIFYSTRUCT
{
uint cbSize;
uint dwFlags;
void* hwndTarget;
POINTS ptsLocation;
uint dwInstanceID;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; GESTURENOTIFYSTRUCT サイズ: 20 バイト(x86)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; hwndTarget : HWND (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ptsLocation : POINTS (+12, 4byte) varptr(st)+12 を基点に操作(4byte:入れ子/配列)
; dwInstanceID : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GESTURENOTIFYSTRUCT サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; hwndTarget : HWND (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; ptsLocation : POINTS (+16, 4byte) varptr(st)+16 を基点に操作(4byte:入れ子/配列)
; dwInstanceID : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (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 GESTURENOTIFYSTRUCT
#field int cbSize
#field int dwFlags
#field intptr hwndTarget
#field POINTS ptsLocation
#field int dwInstanceID
#endstruct
stdim st, GESTURENOTIFYSTRUCT ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize