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

LINETRANSLATEOUTPUT

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

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

フィールド

フィールドサイズx64x86説明
dwTotalSizeDWORD4+0+0アプリが確保した構造体全体のサイズをバイト単位で示す。
dwNeededSizeDWORD4+4+4全情報を格納するのに必要なサイズをバイト単位で示す。
dwUsedSizeDWORD4+8+8実際に使用されたサイズをバイト単位で示す。
dwDialableStringSizeDWORD4+12+12ダイヤル可能文字列のサイズをバイト単位で示す。
dwDialableStringOffsetDWORD4+16+16ダイヤル可能文字列への構造体先頭からのバイトオフセットを示す。
dwDisplayableStringSizeDWORD4+20+20表示用文字列のサイズをバイト単位で示す。
dwDisplayableStringOffsetDWORD4+24+24表示用文字列への構造体先頭からのバイトオフセットを示す。
dwCurrentCountryDWORD4+28+28現在のロケーションの国コードを示す。
dwDestCountryDWORD4+32+32発信先の国コードを示す。
dwTranslateResultsDWORD4+36+36変換結果に関するLINETRANSLATERESULTビットフラグを示す。

各言語での定義

#include <windows.h>

// LINETRANSLATEOUTPUT  (x64 40 / x86 40 バイト)
#pragma pack(push, 1)
typedef struct LINETRANSLATEOUTPUT {
    DWORD dwTotalSize;
    DWORD dwNeededSize;
    DWORD dwUsedSize;
    DWORD dwDialableStringSize;
    DWORD dwDialableStringOffset;
    DWORD dwDisplayableStringSize;
    DWORD dwDisplayableStringOffset;
    DWORD dwCurrentCountry;
    DWORD dwDestCountry;
    DWORD dwTranslateResults;
} LINETRANSLATEOUTPUT;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct LINETRANSLATEOUTPUT
{
    public uint dwTotalSize;
    public uint dwNeededSize;
    public uint dwUsedSize;
    public uint dwDialableStringSize;
    public uint dwDialableStringOffset;
    public uint dwDisplayableStringSize;
    public uint dwDisplayableStringOffset;
    public uint dwCurrentCountry;
    public uint dwDestCountry;
    public uint dwTranslateResults;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure LINETRANSLATEOUTPUT
    Public dwTotalSize As UInteger
    Public dwNeededSize As UInteger
    Public dwUsedSize As UInteger
    Public dwDialableStringSize As UInteger
    Public dwDialableStringOffset As UInteger
    Public dwDisplayableStringSize As UInteger
    Public dwDisplayableStringOffset As UInteger
    Public dwCurrentCountry As UInteger
    Public dwDestCountry As UInteger
    Public dwTranslateResults As UInteger
End Structure
import ctypes
from ctypes import wintypes

class LINETRANSLATEOUTPUT(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("dwTotalSize", wintypes.DWORD),
        ("dwNeededSize", wintypes.DWORD),
        ("dwUsedSize", wintypes.DWORD),
        ("dwDialableStringSize", wintypes.DWORD),
        ("dwDialableStringOffset", wintypes.DWORD),
        ("dwDisplayableStringSize", wintypes.DWORD),
        ("dwDisplayableStringOffset", wintypes.DWORD),
        ("dwCurrentCountry", wintypes.DWORD),
        ("dwDestCountry", wintypes.DWORD),
        ("dwTranslateResults", wintypes.DWORD),
    ]
#[repr(C, packed(1))]
pub struct LINETRANSLATEOUTPUT {
    pub dwTotalSize: u32,
    pub dwNeededSize: u32,
    pub dwUsedSize: u32,
    pub dwDialableStringSize: u32,
    pub dwDialableStringOffset: u32,
    pub dwDisplayableStringSize: u32,
    pub dwDisplayableStringOffset: u32,
    pub dwCurrentCountry: u32,
    pub dwDestCountry: u32,
    pub dwTranslateResults: u32,
}
import "golang.org/x/sys/windows"

type LINETRANSLATEOUTPUT struct {
	dwTotalSize uint32
	dwNeededSize uint32
	dwUsedSize uint32
	dwDialableStringSize uint32
	dwDialableStringOffset uint32
	dwDisplayableStringSize uint32
	dwDisplayableStringOffset uint32
	dwCurrentCountry uint32
	dwDestCountry uint32
	dwTranslateResults uint32
}
type
  LINETRANSLATEOUTPUT = packed record
    dwTotalSize: DWORD;
    dwNeededSize: DWORD;
    dwUsedSize: DWORD;
    dwDialableStringSize: DWORD;
    dwDialableStringOffset: DWORD;
    dwDisplayableStringSize: DWORD;
    dwDisplayableStringOffset: DWORD;
    dwCurrentCountry: DWORD;
    dwDestCountry: DWORD;
    dwTranslateResults: DWORD;
  end;
const LINETRANSLATEOUTPUT = extern struct {
    dwTotalSize: u32,
    dwNeededSize: u32,
    dwUsedSize: u32,
    dwDialableStringSize: u32,
    dwDialableStringOffset: u32,
    dwDisplayableStringSize: u32,
    dwDisplayableStringOffset: u32,
    dwCurrentCountry: u32,
    dwDestCountry: u32,
    dwTranslateResults: u32,
};
type
  LINETRANSLATEOUTPUT {.packed.} = object
    dwTotalSize: uint32
    dwNeededSize: uint32
    dwUsedSize: uint32
    dwDialableStringSize: uint32
    dwDialableStringOffset: uint32
    dwDisplayableStringSize: uint32
    dwDisplayableStringOffset: uint32
    dwCurrentCountry: uint32
    dwDestCountry: uint32
    dwTranslateResults: uint32
align(1)
struct LINETRANSLATEOUTPUT
{
    uint dwTotalSize;
    uint dwNeededSize;
    uint dwUsedSize;
    uint dwDialableStringSize;
    uint dwDialableStringOffset;
    uint dwDisplayableStringSize;
    uint dwDisplayableStringOffset;
    uint dwCurrentCountry;
    uint dwDestCountry;
    uint dwTranslateResults;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; LINETRANSLATEOUTPUT サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 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 も可)
; dwDialableStringSize : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; dwDialableStringOffset : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; dwDisplayableStringSize : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; dwDisplayableStringOffset : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; dwCurrentCountry : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; dwDestCountry : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; dwTranslateResults : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global LINETRANSLATEOUTPUT, pack=1
    #field int dwTotalSize
    #field int dwNeededSize
    #field int dwUsedSize
    #field int dwDialableStringSize
    #field int dwDialableStringOffset
    #field int dwDisplayableStringSize
    #field int dwDisplayableStringOffset
    #field int dwCurrentCountry
    #field int dwDestCountry
    #field int dwTranslateResults
#endstruct

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