Win32 API 日本語リファレンス
ホームDevices.Tapi › LINETRANSLATECAPS

LINETRANSLATECAPS

構造体
サイズx64: 44 バイト / x86: 44 バイトパッキング1

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

フィールド

フィールドサイズx64x86説明
dwTotalSizeDWORD4+0+0アプリが確保した構造体全体のサイズをバイト単位で示す。
dwNeededSizeDWORD4+4+4全情報を格納するのに必要なサイズをバイト単位で示す。
dwUsedSizeDWORD4+8+8実際に使用されたサイズをバイト単位で示す。
dwNumLocationsDWORD4+12+12ロケーションリストに含まれるロケーション数を示す。
dwLocationListSizeDWORD4+16+16ロケーションリスト領域のサイズをバイト単位で示す。
dwLocationListOffsetDWORD4+20+20ロケーションリストへの構造体先頭からのバイトオフセットを示す。
dwCurrentLocationIDDWORD4+24+24現在選択中のロケーションを識別するIDを示す。
dwNumCardsDWORD4+28+28コーリングカードリストに含まれるカード数を示す。
dwCardListSizeDWORD4+32+32コーリングカードリスト領域のサイズをバイト単位で示す。
dwCardListOffsetDWORD4+36+36コーリングカードリストへの構造体先頭からのバイトオフセットを示す。
dwCurrentPreferredCardIDDWORD4+40+40現在優先されるコーリングカードのIDを示す。

各言語での定義

#include <windows.h>

// LINETRANSLATECAPS  (x64 44 / x86 44 バイト)
#pragma pack(push, 1)
typedef struct LINETRANSLATECAPS {
    DWORD dwTotalSize;
    DWORD dwNeededSize;
    DWORD dwUsedSize;
    DWORD dwNumLocations;
    DWORD dwLocationListSize;
    DWORD dwLocationListOffset;
    DWORD dwCurrentLocationID;
    DWORD dwNumCards;
    DWORD dwCardListSize;
    DWORD dwCardListOffset;
    DWORD dwCurrentPreferredCardID;
} LINETRANSLATECAPS;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct LINETRANSLATECAPS
{
    public uint dwTotalSize;
    public uint dwNeededSize;
    public uint dwUsedSize;
    public uint dwNumLocations;
    public uint dwLocationListSize;
    public uint dwLocationListOffset;
    public uint dwCurrentLocationID;
    public uint dwNumCards;
    public uint dwCardListSize;
    public uint dwCardListOffset;
    public uint dwCurrentPreferredCardID;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure LINETRANSLATECAPS
    Public dwTotalSize As UInteger
    Public dwNeededSize As UInteger
    Public dwUsedSize As UInteger
    Public dwNumLocations As UInteger
    Public dwLocationListSize As UInteger
    Public dwLocationListOffset As UInteger
    Public dwCurrentLocationID As UInteger
    Public dwNumCards As UInteger
    Public dwCardListSize As UInteger
    Public dwCardListOffset As UInteger
    Public dwCurrentPreferredCardID As UInteger
End Structure
import ctypes
from ctypes import wintypes

class LINETRANSLATECAPS(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("dwTotalSize", wintypes.DWORD),
        ("dwNeededSize", wintypes.DWORD),
        ("dwUsedSize", wintypes.DWORD),
        ("dwNumLocations", wintypes.DWORD),
        ("dwLocationListSize", wintypes.DWORD),
        ("dwLocationListOffset", wintypes.DWORD),
        ("dwCurrentLocationID", wintypes.DWORD),
        ("dwNumCards", wintypes.DWORD),
        ("dwCardListSize", wintypes.DWORD),
        ("dwCardListOffset", wintypes.DWORD),
        ("dwCurrentPreferredCardID", wintypes.DWORD),
    ]
#[repr(C, packed(1))]
pub struct LINETRANSLATECAPS {
    pub dwTotalSize: u32,
    pub dwNeededSize: u32,
    pub dwUsedSize: u32,
    pub dwNumLocations: u32,
    pub dwLocationListSize: u32,
    pub dwLocationListOffset: u32,
    pub dwCurrentLocationID: u32,
    pub dwNumCards: u32,
    pub dwCardListSize: u32,
    pub dwCardListOffset: u32,
    pub dwCurrentPreferredCardID: u32,
}
import "golang.org/x/sys/windows"

type LINETRANSLATECAPS struct {
	dwTotalSize uint32
	dwNeededSize uint32
	dwUsedSize uint32
	dwNumLocations uint32
	dwLocationListSize uint32
	dwLocationListOffset uint32
	dwCurrentLocationID uint32
	dwNumCards uint32
	dwCardListSize uint32
	dwCardListOffset uint32
	dwCurrentPreferredCardID uint32
}
type
  LINETRANSLATECAPS = packed record
    dwTotalSize: DWORD;
    dwNeededSize: DWORD;
    dwUsedSize: DWORD;
    dwNumLocations: DWORD;
    dwLocationListSize: DWORD;
    dwLocationListOffset: DWORD;
    dwCurrentLocationID: DWORD;
    dwNumCards: DWORD;
    dwCardListSize: DWORD;
    dwCardListOffset: DWORD;
    dwCurrentPreferredCardID: DWORD;
  end;
const LINETRANSLATECAPS = extern struct {
    dwTotalSize: u32,
    dwNeededSize: u32,
    dwUsedSize: u32,
    dwNumLocations: u32,
    dwLocationListSize: u32,
    dwLocationListOffset: u32,
    dwCurrentLocationID: u32,
    dwNumCards: u32,
    dwCardListSize: u32,
    dwCardListOffset: u32,
    dwCurrentPreferredCardID: u32,
};
type
  LINETRANSLATECAPS {.packed.} = object
    dwTotalSize: uint32
    dwNeededSize: uint32
    dwUsedSize: uint32
    dwNumLocations: uint32
    dwLocationListSize: uint32
    dwLocationListOffset: uint32
    dwCurrentLocationID: uint32
    dwNumCards: uint32
    dwCardListSize: uint32
    dwCardListOffset: uint32
    dwCurrentPreferredCardID: uint32
align(1)
struct LINETRANSLATECAPS
{
    uint dwTotalSize;
    uint dwNeededSize;
    uint dwUsedSize;
    uint dwNumLocations;
    uint dwLocationListSize;
    uint dwLocationListOffset;
    uint dwCurrentLocationID;
    uint dwNumCards;
    uint dwCardListSize;
    uint dwCardListOffset;
    uint dwCurrentPreferredCardID;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; LINETRANSLATECAPS サイズ: 44 バイト(x64)
dim st, 11    ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; dwTotalSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwNeededSize : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwUsedSize : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwNumLocations : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; dwLocationListSize : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; dwLocationListOffset : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; dwCurrentLocationID : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; dwNumCards : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; dwCardListSize : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; dwCardListOffset : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; dwCurrentPreferredCardID : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global LINETRANSLATECAPS, pack=1
    #field int dwTotalSize
    #field int dwNeededSize
    #field int dwUsedSize
    #field int dwNumLocations
    #field int dwLocationListSize
    #field int dwLocationListOffset
    #field int dwCurrentLocationID
    #field int dwNumCards
    #field int dwCardListSize
    #field int dwCardListOffset
    #field int dwCurrentPreferredCardID
#endstruct

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