ホーム › UI.Input.Ime › IMEDP
IMEDP
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| wrdModifier | IMEWRD | 48/32 | +0 | +0 | 係り受けの修飾語を示すIMEWRDである。 |
| wrdModifiee | IMEWRD | 48/32 | +48 | +32 | 係り受けの被修飾語を示すIMEWRDである。 |
| relID | IMEREL | 4 | +96 | +64 | 両語間の関連種別を示すIMEREL値である。 |
各言語での定義
#include <windows.h>
// IMEWRD (x64 48 / x86 32 バイト)
#pragma pack(push, 1)
typedef struct IMEWRD {
LPWSTR pwchReading;
LPWSTR pwchDisplay;
_Anonymous_e__Union Anonymous;
DWORD rgulAttrs[2];
INT cbComment;
IMEUCT uct;
void* pvComment;
} IMEWRD;
#pragma pack(pop)
// IMEDP (x64 100 / x86 68 バイト)
#pragma pack(push, 1)
typedef struct IMEDP {
IMEWRD wrdModifier;
IMEWRD wrdModifiee;
IMEREL relID;
} IMEDP;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct IMEWRD
{
public IntPtr pwchReading;
public IntPtr pwchDisplay;
public _Anonymous_e__Union Anonymous;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public uint[] rgulAttrs;
public int cbComment;
public int uct;
public IntPtr pvComment;
}
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct IMEDP
{
public IMEWRD wrdModifier;
public IMEWRD wrdModifiee;
public int relID;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure IMEWRD
Public pwchReading As IntPtr
Public pwchDisplay As IntPtr
Public Anonymous As _Anonymous_e__Union
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=2)> Public rgulAttrs() As UInteger
Public cbComment As Integer
Public uct As Integer
Public pvComment As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure IMEDP
Public wrdModifier As IMEWRD
Public wrdModifiee As IMEWRD
Public relID As Integer
End Structureimport ctypes
from ctypes import wintypes
class IMEWRD(ctypes.Structure):
_pack_ = 1
_fields_ = [
("pwchReading", ctypes.c_void_p),
("pwchDisplay", ctypes.c_void_p),
("Anonymous", _Anonymous_e__Union),
("rgulAttrs", wintypes.DWORD * 2),
("cbComment", ctypes.c_int),
("uct", ctypes.c_int),
("pvComment", ctypes.c_void_p),
]
class IMEDP(ctypes.Structure):
_pack_ = 1
_fields_ = [
("wrdModifier", IMEWRD),
("wrdModifiee", IMEWRD),
("relID", ctypes.c_int),
]#[repr(C, packed(1))]
pub struct IMEWRD {
pub pwchReading: *mut core::ffi::c_void,
pub pwchDisplay: *mut core::ffi::c_void,
pub Anonymous: _Anonymous_e__Union,
pub rgulAttrs: [u32; 2],
pub cbComment: i32,
pub uct: i32,
pub pvComment: *mut core::ffi::c_void,
}
#[repr(C, packed(1))]
pub struct IMEDP {
pub wrdModifier: IMEWRD,
pub wrdModifiee: IMEWRD,
pub relID: i32,
}import "golang.org/x/sys/windows"
type IMEWRD struct {
pwchReading uintptr
pwchDisplay uintptr
Anonymous _Anonymous_e__Union
rgulAttrs [2]uint32
cbComment int32
uct int32
pvComment uintptr
}
type IMEDP struct {
wrdModifier IMEWRD
wrdModifiee IMEWRD
relID int32
}type
IMEWRD = packed record
pwchReading: Pointer;
pwchDisplay: Pointer;
Anonymous: _Anonymous_e__Union;
rgulAttrs: array[0..1] of DWORD;
cbComment: Integer;
uct: Integer;
pvComment: Pointer;
end;
IMEDP = packed record
wrdModifier: IMEWRD;
wrdModifiee: IMEWRD;
relID: Integer;
end;const IMEWRD = extern struct {
pwchReading: ?*anyopaque,
pwchDisplay: ?*anyopaque,
Anonymous: _Anonymous_e__Union,
rgulAttrs: [2]u32,
cbComment: i32,
uct: i32,
pvComment: ?*anyopaque,
};
const IMEDP = extern struct {
wrdModifier: IMEWRD,
wrdModifiee: IMEWRD,
relID: i32,
};type
IMEWRD {.packed.} = object
pwchReading: pointer
pwchDisplay: pointer
Anonymous: _Anonymous_e__Union
rgulAttrs: array[2, uint32]
cbComment: int32
uct: int32
pvComment: pointer
IMEDP {.packed.} = object
wrdModifier: IMEWRD
wrdModifiee: IMEWRD
relID: int32align(1)
struct IMEWRD
{
void* pwchReading;
void* pwchDisplay;
_Anonymous_e__Union Anonymous;
uint[2] rgulAttrs;
int cbComment;
int uct;
void* pvComment;
}
align(1)
struct IMEDP
{
IMEWRD wrdModifier;
IMEWRD wrdModifiee;
int relID;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; IMEDP サイズ: 68 バイト(x86)
dim st, 17 ; 4byte整数×17(構造体サイズ 68 / 4 切り上げ)
; wrdModifier : IMEWRD (+0, 32byte) varptr(st)+0 を基点に操作(32byte:入れ子/配列)
; wrdModifiee : IMEWRD (+32, 32byte) varptr(st)+32 を基点に操作(32byte:入れ子/配列)
; relID : IMEREL (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; IMEDP サイズ: 100 バイト(x64)
dim st, 25 ; 4byte整数×25(構造体サイズ 100 / 4 切り上げ)
; wrdModifier : IMEWRD (+0, 48byte) varptr(st)+0 を基点に操作(48byte:入れ子/配列)
; wrdModifiee : IMEWRD (+48, 48byte) varptr(st)+48 を基点に操作(48byte:入れ子/配列)
; relID : IMEREL (+96, 4byte) st.24 = 値 / 値 = st.24 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global IMEWRD, pack=1
#field intptr pwchReading
#field intptr pwchDisplay
#field byte Anonymous 8
#field int rgulAttrs 2
#field int cbComment
#field int uct
#field intptr pvComment
#endstruct
#defstruct global IMEDP, pack=1
#field IMEWRD wrdModifier
#field IMEWRD wrdModifiee
#field int relID
#endstruct
stdim st, IMEDP ; NSTRUCT 変数を確保
st->relID = 100
mes "relID=" + st->relID