ホーム › UI.Input.Ime › IMEMENUITEMINFOW
IMEMENUITEMINFOW
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | 本構造体のサイズをバイト単位で示す。 |
| fType | DWORD | 4 | +4 | +4 | メニュー項目の種別を示すフラグである。 |
| fState | DWORD | 4 | +8 | +8 | メニュー項目の状態を示すフラグである。 |
| wID | DWORD | 4 | +12 | +12 | メニュー項目の識別子である。 |
| hbmpChecked | HBITMAP | 8/4 | +16 | +16 | チェック時に表示するビットマップハンドルである。 |
| hbmpUnchecked | HBITMAP | 8/4 | +24 | +20 | 非チェック時に表示するビットマップハンドルである。 |
| dwItemData | DWORD | 4 | +32 | +24 | 項目に関連付けるアプリ定義データである。 |
| szString | WCHAR | 160 | +36 | +28 | メニュー項目のテキストを示すUnicode文字列である。 |
| hbmpItem | HBITMAP | 8/4 | +200 | +188 | 項目に表示するビットマップハンドルである。 |
各言語での定義
#include <windows.h>
// IMEMENUITEMINFOW (x64 208 / x86 192 バイト)
typedef struct IMEMENUITEMINFOW {
DWORD cbSize;
DWORD fType;
DWORD fState;
DWORD wID;
HBITMAP hbmpChecked;
HBITMAP hbmpUnchecked;
DWORD dwItemData;
WCHAR szString[80];
HBITMAP hbmpItem;
} IMEMENUITEMINFOW;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IMEMENUITEMINFOW
{
public uint cbSize;
public uint fType;
public uint fState;
public uint wID;
public IntPtr hbmpChecked;
public IntPtr hbmpUnchecked;
public uint dwItemData;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)] public string szString;
public IntPtr hbmpItem;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IMEMENUITEMINFOW
Public cbSize As UInteger
Public fType As UInteger
Public fState As UInteger
Public wID As UInteger
Public hbmpChecked As IntPtr
Public hbmpUnchecked As IntPtr
Public dwItemData As UInteger
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=80)> Public szString As String
Public hbmpItem As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class IMEMENUITEMINFOW(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("fType", wintypes.DWORD),
("fState", wintypes.DWORD),
("wID", wintypes.DWORD),
("hbmpChecked", ctypes.c_void_p),
("hbmpUnchecked", ctypes.c_void_p),
("dwItemData", wintypes.DWORD),
("szString", ctypes.c_wchar * 80),
("hbmpItem", ctypes.c_void_p),
]#[repr(C)]
pub struct IMEMENUITEMINFOW {
pub cbSize: u32,
pub fType: u32,
pub fState: u32,
pub wID: u32,
pub hbmpChecked: *mut core::ffi::c_void,
pub hbmpUnchecked: *mut core::ffi::c_void,
pub dwItemData: u32,
pub szString: [u16; 80],
pub hbmpItem: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type IMEMENUITEMINFOW struct {
cbSize uint32
fType uint32
fState uint32
wID uint32
hbmpChecked uintptr
hbmpUnchecked uintptr
dwItemData uint32
szString [80]uint16
hbmpItem uintptr
}type
IMEMENUITEMINFOW = record
cbSize: DWORD;
fType: DWORD;
fState: DWORD;
wID: DWORD;
hbmpChecked: Pointer;
hbmpUnchecked: Pointer;
dwItemData: DWORD;
szString: array[0..79] of WideChar;
hbmpItem: Pointer;
end;const IMEMENUITEMINFOW = extern struct {
cbSize: u32,
fType: u32,
fState: u32,
wID: u32,
hbmpChecked: ?*anyopaque,
hbmpUnchecked: ?*anyopaque,
dwItemData: u32,
szString: [80]u16,
hbmpItem: ?*anyopaque,
};type
IMEMENUITEMINFOW {.bycopy.} = object
cbSize: uint32
fType: uint32
fState: uint32
wID: uint32
hbmpChecked: pointer
hbmpUnchecked: pointer
dwItemData: uint32
szString: array[80, uint16]
hbmpItem: pointerstruct IMEMENUITEMINFOW
{
uint cbSize;
uint fType;
uint fState;
uint wID;
void* hbmpChecked;
void* hbmpUnchecked;
uint dwItemData;
wchar[80] szString;
void* hbmpItem;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; IMEMENUITEMINFOW サイズ: 192 バイト(x86)
dim st, 48 ; 4byte整数×48(構造体サイズ 192 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; fType : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; fState : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; wID : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; hbmpChecked : HBITMAP (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; hbmpUnchecked : HBITMAP (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; dwItemData : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; szString : WCHAR (+28, 160byte) varptr(st)+28 を基点に操作(160byte:入れ子/配列)
; hbmpItem : HBITMAP (+188, 4byte) st.47 = 値 / 値 = st.47 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; IMEMENUITEMINFOW サイズ: 208 バイト(x64)
dim st, 52 ; 4byte整数×52(構造体サイズ 208 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; fType : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; fState : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; wID : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; hbmpChecked : HBITMAP (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; hbmpUnchecked : HBITMAP (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; dwItemData : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; szString : WCHAR (+36, 160byte) varptr(st)+36 を基点に操作(160byte:入れ子/配列)
; hbmpItem : HBITMAP (+200, 8byte) qpoke st,200,値 / qpeek(st,200) ※IronHSPのみ。3.7/3.8は lpoke st,200,下位 : lpoke st,204,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global IMEMENUITEMINFOW
#field int cbSize
#field int fType
#field int fState
#field int wID
#field intptr hbmpChecked
#field intptr hbmpUnchecked
#field int dwItemData
#field wchar szString 80
#field intptr hbmpItem
#endstruct
stdim st, IMEMENUITEMINFOW ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize