Win32 API 日本語リファレンス
ホームUI.TabletPC › GESTURE_DATA

GESTURE_DATA

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

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

フィールド

フィールドサイズx64x86説明
gestureIdINT4+0+0認識されたジェスチャーの識別子。
recoConfidenceINT4+4+4認識の信頼度を示す値。
strokeCountINT4+8+8ジェスチャーを構成するストローク数。

各言語での定義

#include <windows.h>

// GESTURE_DATA  (x64 12 / x86 12 バイト)
typedef struct GESTURE_DATA {
    INT gestureId;
    INT recoConfidence;
    INT strokeCount;
} GESTURE_DATA;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GESTURE_DATA
{
    public int gestureId;
    public int recoConfidence;
    public int strokeCount;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GESTURE_DATA
    Public gestureId As Integer
    Public recoConfidence As Integer
    Public strokeCount As Integer
End Structure
import ctypes
from ctypes import wintypes

class GESTURE_DATA(ctypes.Structure):
    _fields_ = [
        ("gestureId", ctypes.c_int),
        ("recoConfidence", ctypes.c_int),
        ("strokeCount", ctypes.c_int),
    ]
#[repr(C)]
pub struct GESTURE_DATA {
    pub gestureId: i32,
    pub recoConfidence: i32,
    pub strokeCount: i32,
}
import "golang.org/x/sys/windows"

type GESTURE_DATA struct {
	gestureId int32
	recoConfidence int32
	strokeCount int32
}
type
  GESTURE_DATA = record
    gestureId: Integer;
    recoConfidence: Integer;
    strokeCount: Integer;
  end;
const GESTURE_DATA = extern struct {
    gestureId: i32,
    recoConfidence: i32,
    strokeCount: i32,
};
type
  GESTURE_DATA {.bycopy.} = object
    gestureId: int32
    recoConfidence: int32
    strokeCount: int32
struct GESTURE_DATA
{
    int gestureId;
    int recoConfidence;
    int strokeCount;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GESTURE_DATA サイズ: 12 バイト(x64)
dim st, 3    ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; gestureId : INT (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; recoConfidence : INT (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; strokeCount : INT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global GESTURE_DATA
    #field int gestureId
    #field int recoConfidence
    #field int strokeCount
#endstruct

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