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

StylusInfo

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

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

フィールド

フィールドサイズx64x86説明
tcidDWORD4+0+0タブレットコンテキストの識別子。
cidDWORD4+4+4カーソル(スタイラス)の識別子。
bIsInvertedCursorBOOL4+8+8カーソルが反転(消しゴム側)かどうかを示す真偽値。

各言語での定義

#include <windows.h>

// StylusInfo  (x64 12 / x86 12 バイト)
typedef struct StylusInfo {
    DWORD tcid;
    DWORD cid;
    BOOL bIsInvertedCursor;
} StylusInfo;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct StylusInfo
{
    public uint tcid;
    public uint cid;
    [MarshalAs(UnmanagedType.Bool)] public bool bIsInvertedCursor;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure StylusInfo
    Public tcid As UInteger
    Public cid As UInteger
    <MarshalAs(UnmanagedType.Bool)> Public bIsInvertedCursor As Boolean
End Structure
import ctypes
from ctypes import wintypes

class StylusInfo(ctypes.Structure):
    _fields_ = [
        ("tcid", wintypes.DWORD),
        ("cid", wintypes.DWORD),
        ("bIsInvertedCursor", wintypes.BOOL),
    ]
#[repr(C)]
pub struct StylusInfo {
    pub tcid: u32,
    pub cid: u32,
    pub bIsInvertedCursor: i32,
}
import "golang.org/x/sys/windows"

type StylusInfo struct {
	tcid uint32
	cid uint32
	bIsInvertedCursor int32
}
type
  StylusInfo = record
    tcid: DWORD;
    cid: DWORD;
    bIsInvertedCursor: BOOL;
  end;
const StylusInfo = extern struct {
    tcid: u32,
    cid: u32,
    bIsInvertedCursor: i32,
};
type
  StylusInfo {.bycopy.} = object
    tcid: uint32
    cid: uint32
    bIsInvertedCursor: int32
struct StylusInfo
{
    uint tcid;
    uint cid;
    int bIsInvertedCursor;
}

HSP用 定義

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

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

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