ホーム › UI.Input.Ime › TRANSMSGLIST
TRANSMSGLIST
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| uMsgCount | DWORD | 4 | +0 | +0 | TransMsg配列に格納されたメッセージ個数である。 |
| TransMsg | TRANSMSG | 24/12 | +8 | +4 | 生成されたTRANSMSGメッセージ配列の先頭である。 |
各言語での定義
#include <windows.h>
// TRANSMSG (x64 24 / x86 12 バイト)
typedef struct TRANSMSG {
DWORD message;
WPARAM wParam;
LPARAM lParam;
} TRANSMSG;
// TRANSMSGLIST (x64 32 / x86 16 バイト)
typedef struct TRANSMSGLIST {
DWORD uMsgCount;
TRANSMSG TransMsg[1];
} TRANSMSGLIST;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TRANSMSG
{
public uint message;
public UIntPtr wParam;
public IntPtr lParam;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TRANSMSGLIST
{
public uint uMsgCount;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public TRANSMSG[] TransMsg;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TRANSMSG
Public message As UInteger
Public wParam As UIntPtr
Public lParam As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TRANSMSGLIST
Public uMsgCount As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public TransMsg() As TRANSMSG
End Structureimport ctypes
from ctypes import wintypes
class TRANSMSG(ctypes.Structure):
_fields_ = [
("message", wintypes.DWORD),
("wParam", ctypes.c_size_t),
("lParam", ctypes.c_ssize_t),
]
class TRANSMSGLIST(ctypes.Structure):
_fields_ = [
("uMsgCount", wintypes.DWORD),
("TransMsg", TRANSMSG * 1),
]#[repr(C)]
pub struct TRANSMSG {
pub message: u32,
pub wParam: usize,
pub lParam: isize,
}
#[repr(C)]
pub struct TRANSMSGLIST {
pub uMsgCount: u32,
pub TransMsg: [TRANSMSG; 1],
}import "golang.org/x/sys/windows"
type TRANSMSG struct {
message uint32
wParam uintptr
lParam uintptr
}
type TRANSMSGLIST struct {
uMsgCount uint32
TransMsg [1]TRANSMSG
}type
TRANSMSG = record
message: DWORD;
wParam: NativeUInt;
lParam: NativeInt;
end;
TRANSMSGLIST = record
uMsgCount: DWORD;
TransMsg: array[0..0] of TRANSMSG;
end;const TRANSMSG = extern struct {
message: u32,
wParam: usize,
lParam: isize,
};
const TRANSMSGLIST = extern struct {
uMsgCount: u32,
TransMsg: [1]TRANSMSG,
};type
TRANSMSG {.bycopy.} = object
message: uint32
wParam: uint
lParam: int
TRANSMSGLIST {.bycopy.} = object
uMsgCount: uint32
TransMsg: array[1, TRANSMSG]struct TRANSMSG
{
uint message;
size_t wParam;
ptrdiff_t lParam;
}
struct TRANSMSGLIST
{
uint uMsgCount;
TRANSMSG[1] TransMsg;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; TRANSMSGLIST サイズ: 16 バイト(x86)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; uMsgCount : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; TransMsg : TRANSMSG (+4, 12byte) varptr(st)+4 を基点に操作(12byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; TRANSMSGLIST サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; uMsgCount : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; TransMsg : TRANSMSG (+8, 24byte) varptr(st)+8 を基点に操作(24byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global TRANSMSG
#field int message
#field intptr wParam
#field intptr lParam
#endstruct
#defstruct global TRANSMSGLIST
#field int uMsgCount
#field TRANSMSG TransMsg 1
#endstruct
stdim st, TRANSMSGLIST ; NSTRUCT 変数を確保
st->uMsgCount = 100
mes "uMsgCount=" + st->uMsgCount