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

TOUCHPREDICTIONPARAMETERS

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

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

フィールド

フィールドサイズx64x86説明
cbSizeDWORD4+0+0この構造体のサイズ(バイト数)である。
dwLatencyDWORD4+4+4予測対象とするレイテンシ(ミリ秒)である。
dwSampleTimeDWORD4+8+8タッチサンプリングの間隔(ミリ秒)である。
bUseHWTimeStampDWORD4+12+12ハードウェアのタイムスタンプを使用するかどうかを示す値である。

各言語での定義

#include <windows.h>

// TOUCHPREDICTIONPARAMETERS  (x64 16 / x86 16 バイト)
typedef struct TOUCHPREDICTIONPARAMETERS {
    DWORD cbSize;
    DWORD dwLatency;
    DWORD dwSampleTime;
    DWORD bUseHWTimeStamp;
} TOUCHPREDICTIONPARAMETERS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TOUCHPREDICTIONPARAMETERS
{
    public uint cbSize;
    public uint dwLatency;
    public uint dwSampleTime;
    public uint bUseHWTimeStamp;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TOUCHPREDICTIONPARAMETERS
    Public cbSize As UInteger
    Public dwLatency As UInteger
    Public dwSampleTime As UInteger
    Public bUseHWTimeStamp As UInteger
End Structure
import ctypes
from ctypes import wintypes

class TOUCHPREDICTIONPARAMETERS(ctypes.Structure):
    _fields_ = [
        ("cbSize", wintypes.DWORD),
        ("dwLatency", wintypes.DWORD),
        ("dwSampleTime", wintypes.DWORD),
        ("bUseHWTimeStamp", wintypes.DWORD),
    ]
#[repr(C)]
pub struct TOUCHPREDICTIONPARAMETERS {
    pub cbSize: u32,
    pub dwLatency: u32,
    pub dwSampleTime: u32,
    pub bUseHWTimeStamp: u32,
}
import "golang.org/x/sys/windows"

type TOUCHPREDICTIONPARAMETERS struct {
	cbSize uint32
	dwLatency uint32
	dwSampleTime uint32
	bUseHWTimeStamp uint32
}
type
  TOUCHPREDICTIONPARAMETERS = record
    cbSize: DWORD;
    dwLatency: DWORD;
    dwSampleTime: DWORD;
    bUseHWTimeStamp: DWORD;
  end;
const TOUCHPREDICTIONPARAMETERS = extern struct {
    cbSize: u32,
    dwLatency: u32,
    dwSampleTime: u32,
    bUseHWTimeStamp: u32,
};
type
  TOUCHPREDICTIONPARAMETERS {.bycopy.} = object
    cbSize: uint32
    dwLatency: uint32
    dwSampleTime: uint32
    bUseHWTimeStamp: uint32
struct TOUCHPREDICTIONPARAMETERS
{
    uint cbSize;
    uint dwLatency;
    uint dwSampleTime;
    uint bUseHWTimeStamp;
}

HSP用 定義

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

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

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