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

POINTER_TYPE_INFO

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

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

フィールド

フィールドサイズx64x86説明
typePOINTER_INPUT_TYPE4+0+0ポインタの入力種別。タッチかペンかを示す。
Anonymous_Anonymous_e__Union144/136+8+8typeに応じたPOINTER_TOUCH_INFOまたはPOINTER_PEN_INFOを格納する共用体。

共用体: _Anonymous_e__Union x64 144B / x86 136B

フィールドサイズx64x86
pointerInfoPOINTER_INFO96/88+0+0
touchInfoPOINTER_TOUCH_INFO144/136+0+0
penInfoPOINTER_PEN_INFO120/112+0+0

各言語での定義

#include <windows.h>

// POINTER_TYPE_INFO  (x64 152 / x86 144 バイト)
typedef struct POINTER_TYPE_INFO {
    POINTER_INPUT_TYPE type;
    _Anonymous_e__Union Anonymous;
} POINTER_TYPE_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct POINTER_TYPE_INFO
{
    public int type;
    public _Anonymous_e__Union Anonymous;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure POINTER_TYPE_INFO
    Public type As Integer
    Public Anonymous As _Anonymous_e__Union
End Structure
import ctypes
from ctypes import wintypes

class POINTER_TYPE_INFO(ctypes.Structure):
    _fields_ = [
        ("type", ctypes.c_int),
        ("Anonymous", _Anonymous_e__Union),
    ]
#[repr(C)]
pub struct POINTER_TYPE_INFO {
    pub type: i32,
    pub Anonymous: _Anonymous_e__Union,
}
import "golang.org/x/sys/windows"

type POINTER_TYPE_INFO struct {
	type int32
	Anonymous _Anonymous_e__Union
}
type
  POINTER_TYPE_INFO = record
    type: Integer;
    Anonymous: _Anonymous_e__Union;
  end;
const POINTER_TYPE_INFO = extern struct {
    type: i32,
    Anonymous: _Anonymous_e__Union,
};
type
  POINTER_TYPE_INFO {.bycopy.} = object
    type: int32
    Anonymous: _Anonymous_e__Union
struct POINTER_TYPE_INFO
{
    int type;
    _Anonymous_e__Union Anonymous;
}

HSP用 定義

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

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

stdim st, POINTER_TYPE_INFO        ; NSTRUCT 変数を確保
st->type = 100
mes "type=" + st->type
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。