ホーム › Globalization › UTransPosition
UTransPosition
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| contextStart | INT | 4 | +0 | +0 | 音訳のコンテキスト走査開始位置。 |
| contextLimit | INT | 4 | +4 | +4 | 音訳のコンテキスト走査終端位置。 |
| start | INT | 4 | +8 | +8 | 実際に変換する範囲の開始位置。 |
| limit | INT | 4 | +12 | +12 | 実際に変換する範囲の終端位置。 |
各言語での定義
#include <windows.h>
// UTransPosition (x64 16 / x86 16 バイト)
typedef struct UTransPosition {
INT contextStart;
INT contextLimit;
INT start;
INT limit;
} UTransPosition;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct UTransPosition
{
public int contextStart;
public int contextLimit;
public int start;
public int limit;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure UTransPosition
Public contextStart As Integer
Public contextLimit As Integer
Public start As Integer
Public limit As Integer
End Structureimport ctypes
from ctypes import wintypes
class UTransPosition(ctypes.Structure):
_fields_ = [
("contextStart", ctypes.c_int),
("contextLimit", ctypes.c_int),
("start", ctypes.c_int),
("limit", ctypes.c_int),
]#[repr(C)]
pub struct UTransPosition {
pub contextStart: i32,
pub contextLimit: i32,
pub start: i32,
pub limit: i32,
}import "golang.org/x/sys/windows"
type UTransPosition struct {
contextStart int32
contextLimit int32
start int32
limit int32
}type
UTransPosition = record
contextStart: Integer;
contextLimit: Integer;
start: Integer;
limit: Integer;
end;const UTransPosition = extern struct {
contextStart: i32,
contextLimit: i32,
start: i32,
limit: i32,
};type
UTransPosition {.bycopy.} = object
contextStart: int32
contextLimit: int32
start: int32
limit: int32struct UTransPosition
{
int contextStart;
int contextLimit;
int start;
int limit;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; UTransPosition サイズ: 16 バイト(x64)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; contextStart : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; contextLimit : INT (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; start : INT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; limit : INT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global UTransPosition
#field int contextStart
#field int contextLimit
#field int start
#field int limit
#endstruct
stdim st, UTransPosition ; NSTRUCT 変数を確保
st->contextStart = 100
mes "contextStart=" + st->contextStart