ホーム › UI.Controls › TBBUTTONINFOA
TBBUTTONINFOA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | この構造体のサイズをバイト単位で指定する。 |
| dwMask | TBBUTTONINFOW_MASK | 4 | +4 | +4 | 有効なメンバーを示すTBIF_系マスクフラグの組み合わせ。 |
| idCommand | INT | 4 | +8 | +8 | ボタンのコマンド識別子。TBIF_COMMAND時に有効。 |
| iImage | INT | 4 | +12 | +12 | ボタンのイメージインデックス。TBIF_IMAGE時に有効。 |
| fsState | BYTE | 1 | +16 | +16 | ボタンの状態を示すTBSTATE_系フラグ。TBIF_STATE時に有効。 |
| fsStyle | BYTE | 1 | +17 | +17 | ボタンのスタイルを示すTBSTYLE_系フラグ。TBIF_STYLE時に有効。 |
| cx | WORD | 2 | +18 | +18 | ボタンの幅(ピクセル)。TBIF_SIZE時に有効。 |
| lParam | UINT_PTR | 8/4 | +24 | +20 | ボタンに関連付けるアプリケーション定義データ。TBIF_LPARAM時に有効。 |
| pszText | LPSTR | 8/4 | +32 | +24 | ボタンのテキストを保持するバッファへのポインタ。TBIF_TEXT時に有効。 |
| cchText | INT | 4 | +40 | +28 | pszTextバッファの文字数。 |
各言語での定義
#include <windows.h>
// TBBUTTONINFOA (x64 48 / x86 32 バイト)
typedef struct TBBUTTONINFOA {
DWORD cbSize;
TBBUTTONINFOW_MASK dwMask;
INT idCommand;
INT iImage;
BYTE fsState;
BYTE fsStyle;
WORD cx;
UINT_PTR lParam;
LPSTR pszText;
INT cchText;
} TBBUTTONINFOA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TBBUTTONINFOA
{
public uint cbSize;
public uint dwMask;
public int idCommand;
public int iImage;
public byte fsState;
public byte fsStyle;
public ushort cx;
public UIntPtr lParam;
public IntPtr pszText;
public int cchText;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TBBUTTONINFOA
Public cbSize As UInteger
Public dwMask As UInteger
Public idCommand As Integer
Public iImage As Integer
Public fsState As Byte
Public fsStyle As Byte
Public cx As UShort
Public lParam As UIntPtr
Public pszText As IntPtr
Public cchText As Integer
End Structureimport ctypes
from ctypes import wintypes
class TBBUTTONINFOA(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("dwMask", wintypes.DWORD),
("idCommand", ctypes.c_int),
("iImage", ctypes.c_int),
("fsState", ctypes.c_ubyte),
("fsStyle", ctypes.c_ubyte),
("cx", ctypes.c_ushort),
("lParam", ctypes.c_size_t),
("pszText", ctypes.c_void_p),
("cchText", ctypes.c_int),
]#[repr(C)]
pub struct TBBUTTONINFOA {
pub cbSize: u32,
pub dwMask: u32,
pub idCommand: i32,
pub iImage: i32,
pub fsState: u8,
pub fsStyle: u8,
pub cx: u16,
pub lParam: usize,
pub pszText: *mut core::ffi::c_void,
pub cchText: i32,
}import "golang.org/x/sys/windows"
type TBBUTTONINFOA struct {
cbSize uint32
dwMask uint32
idCommand int32
iImage int32
fsState byte
fsStyle byte
cx uint16
lParam uintptr
pszText uintptr
cchText int32
}type
TBBUTTONINFOA = record
cbSize: DWORD;
dwMask: DWORD;
idCommand: Integer;
iImage: Integer;
fsState: Byte;
fsStyle: Byte;
cx: Word;
lParam: NativeUInt;
pszText: Pointer;
cchText: Integer;
end;const TBBUTTONINFOA = extern struct {
cbSize: u32,
dwMask: u32,
idCommand: i32,
iImage: i32,
fsState: u8,
fsStyle: u8,
cx: u16,
lParam: usize,
pszText: ?*anyopaque,
cchText: i32,
};type
TBBUTTONINFOA {.bycopy.} = object
cbSize: uint32
dwMask: uint32
idCommand: int32
iImage: int32
fsState: uint8
fsStyle: uint8
cx: uint16
lParam: uint
pszText: pointer
cchText: int32struct TBBUTTONINFOA
{
uint cbSize;
uint dwMask;
int idCommand;
int iImage;
ubyte fsState;
ubyte fsStyle;
ushort cx;
size_t lParam;
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 レイアウト)
; TBBUTTONINFOA サイズ: 32 バイト(x86)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwMask : TBBUTTONINFOW_MASK (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; idCommand : INT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; iImage : INT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; fsState : BYTE (+16, 1byte) poke st,16,値 / 値 = peek(st,16)
; fsStyle : BYTE (+17, 1byte) poke st,17,値 / 値 = peek(st,17)
; cx : WORD (+18, 2byte) wpoke st,18,値 / 値 = wpeek(st,18)
; lParam : UINT_PTR (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; pszText : LPSTR (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; cchText : INT (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; TBBUTTONINFOA サイズ: 48 バイト(x64)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwMask : TBBUTTONINFOW_MASK (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; idCommand : INT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; iImage : INT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; fsState : BYTE (+16, 1byte) poke st,16,値 / 値 = peek(st,16)
; fsStyle : BYTE (+17, 1byte) poke st,17,値 / 値 = peek(st,17)
; cx : WORD (+18, 2byte) wpoke st,18,値 / 値 = wpeek(st,18)
; lParam : UINT_PTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; pszText : LPSTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; cchText : INT (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global TBBUTTONINFOA
#field int cbSize
#field int dwMask
#field int idCommand
#field int iImage
#field byte fsState
#field byte fsStyle
#field short cx
#field intptr lParam
#field intptr pszText
#field int cchText
#endstruct
stdim st, TBBUTTONINFOA ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize