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