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

RECO_LATTICE_COLUMN

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

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

フィールド

フィールドサイズx64x86説明
keyDWORD4+0+0列を識別するキー値。
cpPropRECO_LATTICE_PROPERTIES16/8+8+4列に付随するプロパティ群 RECO_LATTICE_PROPERTIES。
cStrokesDWORD4+24+12pStrokes 配列に含まれるストローク数。
pStrokesDWORD*8/4+32+16この列に対応するストローク番号の配列。
cLatticeElementsDWORD4+40+20pLatticeElements 配列に含まれる要素数。
pLatticeElementsRECO_LATTICE_ELEMENT*8/4+48+24列内の認識候補要素 RECO_LATTICE_ELEMENT の配列。

各言語での定義

#include <windows.h>

// RECO_LATTICE_PROPERTIES  (x64 16 / x86 8 バイト)
typedef struct RECO_LATTICE_PROPERTIES {
    DWORD cProperties;
    RECO_LATTICE_PROPERTY** apProps;
} RECO_LATTICE_PROPERTIES;

// RECO_LATTICE_COLUMN  (x64 56 / x86 28 バイト)
typedef struct RECO_LATTICE_COLUMN {
    DWORD key;
    RECO_LATTICE_PROPERTIES cpProp;
    DWORD cStrokes;
    DWORD* pStrokes;
    DWORD cLatticeElements;
    RECO_LATTICE_ELEMENT* pLatticeElements;
} RECO_LATTICE_COLUMN;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RECO_LATTICE_PROPERTIES
{
    public uint cProperties;
    public IntPtr apProps;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RECO_LATTICE_COLUMN
{
    public uint key;
    public RECO_LATTICE_PROPERTIES cpProp;
    public uint cStrokes;
    public IntPtr pStrokes;
    public uint cLatticeElements;
    public IntPtr pLatticeElements;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RECO_LATTICE_PROPERTIES
    Public cProperties As UInteger
    Public apProps As IntPtr
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RECO_LATTICE_COLUMN
    Public key As UInteger
    Public cpProp As RECO_LATTICE_PROPERTIES
    Public cStrokes As UInteger
    Public pStrokes As IntPtr
    Public cLatticeElements As UInteger
    Public pLatticeElements As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class RECO_LATTICE_PROPERTIES(ctypes.Structure):
    _fields_ = [
        ("cProperties", wintypes.DWORD),
        ("apProps", ctypes.c_void_p),
    ]

class RECO_LATTICE_COLUMN(ctypes.Structure):
    _fields_ = [
        ("key", wintypes.DWORD),
        ("cpProp", RECO_LATTICE_PROPERTIES),
        ("cStrokes", wintypes.DWORD),
        ("pStrokes", ctypes.c_void_p),
        ("cLatticeElements", wintypes.DWORD),
        ("pLatticeElements", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct RECO_LATTICE_PROPERTIES {
    pub cProperties: u32,
    pub apProps: *mut core::ffi::c_void,
}

#[repr(C)]
pub struct RECO_LATTICE_COLUMN {
    pub key: u32,
    pub cpProp: RECO_LATTICE_PROPERTIES,
    pub cStrokes: u32,
    pub pStrokes: *mut core::ffi::c_void,
    pub cLatticeElements: u32,
    pub pLatticeElements: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type RECO_LATTICE_PROPERTIES struct {
	cProperties uint32
	apProps uintptr
}

type RECO_LATTICE_COLUMN struct {
	key uint32
	cpProp RECO_LATTICE_PROPERTIES
	cStrokes uint32
	pStrokes uintptr
	cLatticeElements uint32
	pLatticeElements uintptr
}
type
  RECO_LATTICE_PROPERTIES = record
    cProperties: DWORD;
    apProps: Pointer;
  end;

  RECO_LATTICE_COLUMN = record
    key: DWORD;
    cpProp: RECO_LATTICE_PROPERTIES;
    cStrokes: DWORD;
    pStrokes: Pointer;
    cLatticeElements: DWORD;
    pLatticeElements: Pointer;
  end;
const RECO_LATTICE_PROPERTIES = extern struct {
    cProperties: u32,
    apProps: ?*anyopaque,
};

const RECO_LATTICE_COLUMN = extern struct {
    key: u32,
    cpProp: RECO_LATTICE_PROPERTIES,
    cStrokes: u32,
    pStrokes: ?*anyopaque,
    cLatticeElements: u32,
    pLatticeElements: ?*anyopaque,
};
type
  RECO_LATTICE_PROPERTIES {.bycopy.} = object
    cProperties: uint32
    apProps: pointer

  RECO_LATTICE_COLUMN {.bycopy.} = object
    key: uint32
    cpProp: RECO_LATTICE_PROPERTIES
    cStrokes: uint32
    pStrokes: pointer
    cLatticeElements: uint32
    pLatticeElements: pointer
struct RECO_LATTICE_PROPERTIES
{
    uint cProperties;
    void* apProps;
}

struct RECO_LATTICE_COLUMN
{
    uint key;
    RECO_LATTICE_PROPERTIES cpProp;
    uint cStrokes;
    void* pStrokes;
    uint cLatticeElements;
    void* pLatticeElements;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; RECO_LATTICE_COLUMN サイズ: 28 バイト(x86)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; key : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; cpProp : RECO_LATTICE_PROPERTIES (+4, 8byte)  varptr(st)+4 を基点に操作(8byte:入れ子/配列)
; cStrokes : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; pStrokes : DWORD* (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; cLatticeElements : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; pLatticeElements : RECO_LATTICE_ELEMENT* (+24, 4byte)  varptr(st)+24 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; RECO_LATTICE_COLUMN サイズ: 56 バイト(x64)
dim st, 14    ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; key : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; cpProp : RECO_LATTICE_PROPERTIES (+8, 16byte)  varptr(st)+8 を基点に操作(16byte:入れ子/配列)
; cStrokes : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; pStrokes : DWORD* (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; cLatticeElements : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; pLatticeElements : RECO_LATTICE_ELEMENT* (+48, 8byte)  varptr(st)+48 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global RECO_LATTICE_PROPERTIES
    #field int cProperties
    #field intptr apProps
#endstruct

#defstruct global RECO_LATTICE_COLUMN
    #field int key
    #field RECO_LATTICE_PROPERTIES cpProp
    #field int cStrokes
    #field intptr pStrokes
    #field int cLatticeElements
    #field intptr pLatticeElements
#endstruct

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