ホーム › UI.Controls › NMTBDISPINFOW
NMTBDISPINFOW
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| hdr | NMHDR | 24/12 | +0 | +0 | 通知元やコードを含む共通NMHDR構造体。 |
| dwMask | NMTBDISPINFOW_MASK | 4 | +24 | +12 | 要求/提供する情報を示すTBNF_系マスクフラグ。 |
| idCommand | INT | 4 | +28 | +16 | 対象ボタンのコマンド識別子。 |
| lParam | UINT_PTR | 8/4 | +32 | +20 | ボタンに関連付けられたアプリケーション定義データ。 |
| iImage | INT | 4 | +40 | +24 | ボタンのイメージインデックスを受け取る/設定する。 |
| pszText | LPWSTR | 8/4 | +48 | +28 | ボタンテキストを格納するバッファへのポインタ。 |
| cchText | INT | 4 | +56 | +32 | pszTextバッファの文字数。 |
各言語での定義
#include <windows.h>
// NMHDR (x64 24 / x86 12 バイト)
typedef struct NMHDR {
HWND hwndFrom;
UINT_PTR idFrom;
DWORD code;
} NMHDR;
// NMTBDISPINFOW (x64 64 / x86 36 バイト)
typedef struct NMTBDISPINFOW {
NMHDR hdr;
NMTBDISPINFOW_MASK dwMask;
INT idCommand;
UINT_PTR lParam;
INT iImage;
LPWSTR pszText;
INT cchText;
} NMTBDISPINFOW;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NMHDR
{
public IntPtr hwndFrom;
public UIntPtr idFrom;
public uint code;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NMTBDISPINFOW
{
public NMHDR hdr;
public uint dwMask;
public int idCommand;
public UIntPtr lParam;
public int iImage;
public IntPtr pszText;
public int cchText;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NMHDR
Public hwndFrom As IntPtr
Public idFrom As UIntPtr
Public code As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NMTBDISPINFOW
Public hdr As NMHDR
Public dwMask As UInteger
Public idCommand As Integer
Public lParam As UIntPtr
Public iImage As Integer
Public pszText As IntPtr
Public cchText As Integer
End Structureimport ctypes
from ctypes import wintypes
class NMHDR(ctypes.Structure):
_fields_ = [
("hwndFrom", ctypes.c_void_p),
("idFrom", ctypes.c_size_t),
("code", wintypes.DWORD),
]
class NMTBDISPINFOW(ctypes.Structure):
_fields_ = [
("hdr", NMHDR),
("dwMask", wintypes.DWORD),
("idCommand", ctypes.c_int),
("lParam", ctypes.c_size_t),
("iImage", ctypes.c_int),
("pszText", ctypes.c_void_p),
("cchText", ctypes.c_int),
]#[repr(C)]
pub struct NMHDR {
pub hwndFrom: *mut core::ffi::c_void,
pub idFrom: usize,
pub code: u32,
}
#[repr(C)]
pub struct NMTBDISPINFOW {
pub hdr: NMHDR,
pub dwMask: u32,
pub idCommand: i32,
pub lParam: usize,
pub iImage: i32,
pub pszText: *mut core::ffi::c_void,
pub cchText: i32,
}import "golang.org/x/sys/windows"
type NMHDR struct {
hwndFrom uintptr
idFrom uintptr
code uint32
}
type NMTBDISPINFOW struct {
hdr NMHDR
dwMask uint32
idCommand int32
lParam uintptr
iImage int32
pszText uintptr
cchText int32
}type
NMHDR = record
hwndFrom: Pointer;
idFrom: NativeUInt;
code: DWORD;
end;
NMTBDISPINFOW = record
hdr: NMHDR;
dwMask: DWORD;
idCommand: Integer;
lParam: NativeUInt;
iImage: Integer;
pszText: Pointer;
cchText: Integer;
end;const NMHDR = extern struct {
hwndFrom: ?*anyopaque,
idFrom: usize,
code: u32,
};
const NMTBDISPINFOW = extern struct {
hdr: NMHDR,
dwMask: u32,
idCommand: i32,
lParam: usize,
iImage: i32,
pszText: ?*anyopaque,
cchText: i32,
};type
NMHDR {.bycopy.} = object
hwndFrom: pointer
idFrom: uint
code: uint32
NMTBDISPINFOW {.bycopy.} = object
hdr: NMHDR
dwMask: uint32
idCommand: int32
lParam: uint
iImage: int32
pszText: pointer
cchText: int32struct NMHDR
{
void* hwndFrom;
size_t idFrom;
uint code;
}
struct NMTBDISPINFOW
{
NMHDR hdr;
uint dwMask;
int idCommand;
size_t lParam;
int iImage;
void* pszText;
int cchText;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; NMTBDISPINFOW サイズ: 36 バイト(x86)
dim st, 9 ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; hdr : NMHDR (+0, 12byte) varptr(st)+0 を基点に操作(12byte:入れ子/配列)
; dwMask : NMTBDISPINFOW_MASK (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; idCommand : INT (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; lParam : UINT_PTR (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; iImage : INT (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; pszText : LPWSTR (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; cchText : INT (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; NMTBDISPINFOW サイズ: 64 バイト(x64)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; hdr : NMHDR (+0, 24byte) varptr(st)+0 を基点に操作(24byte:入れ子/配列)
; dwMask : NMTBDISPINFOW_MASK (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; idCommand : INT (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; lParam : UINT_PTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; iImage : INT (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; pszText : LPWSTR (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; cchText : INT (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global NMHDR
#field intptr hwndFrom
#field intptr idFrom
#field int code
#endstruct
#defstruct global NMTBDISPINFOW
#field NMHDR hdr
#field int dwMask
#field int idCommand
#field intptr lParam
#field int iImage
#field intptr pszText
#field int cchText
#endstruct
stdim st, NMTBDISPINFOW ; NSTRUCT 変数を確保
st->dwMask = 100
mes "dwMask=" + st->dwMask