REBARBANDINFOW
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | この構造体のサイズ (バイト単位)。この構造体のアドレスをパラメーターとして使用するメッセージを送信する前に、アプリケーションはこのメンバーを設定しなければなりません。 | ||||||||||||||||||||||||||||||
| fMask | DWORD | 4 | +4 | +4 | この構造体のどのメンバーが有効か、または設定しなければならないかを示すフラグです。この値には次の値の組み合わせを指定できます。
| ||||||||||||||||||||||||||||||
| fStyle | DWORD | 4 | +8 | +8 | バンドのスタイルを指定するフラグです。この値には次の値の組み合わせを指定できます。
| ||||||||||||||||||||||||||||||
| clrFore | COLORREF | 4 | +12 | +12 | バンドの前景色です。 | ||||||||||||||||||||||||||||||
| clrBack | COLORREF | 4 | +16 | +16 | バンドの背景色です。hbmBack で背景ビットマップを指定している場合、これらのメンバーは無視されます。既定では、バンドは RB_SETBKCOLOR メッセージで設定された rebar コントロールの背景色を使用します。ここで背景色を指定した場合は、代わりにその背景色が使用されます。 | ||||||||||||||||||||||||||||||
| lpText | LPWSTR | 8/4 | +24 | +20 | バンドに表示するテキストを格納するバッファーへのポインターです。コントロールからバンドの情報を取得する場合で、fMask に RBBIM_TEXT を指定しているときは、このメンバーにテキストを受け取るバッファーのアドレスを設定しておかなければなりません。 | ||||||||||||||||||||||||||||||
| cch | DWORD | 4 | +32 | +24 | lpText が指すバッファーのサイズ (バイト単位)。コントロールから情報を取得しない場合、このメンバーは無視されます。 | ||||||||||||||||||||||||||||||
| iImage | INT | 4 | +36 | +28 | バンドに表示する画像の 0 から始まるインデックスです。イメージ リストは RB_SETBARINFO メッセージで設定します。 | ||||||||||||||||||||||||||||||
| hwndChild | HWND | 8/4 | +40 | +32 | バンドに含まれる子ウィンドウのハンドルです (存在する場合)。 | ||||||||||||||||||||||||||||||
| cxMinChild | DWORD | 4 | +48 | +36 | 子ウィンドウの最小幅 (ピクセル単位)。バンドはこの値より小さいサイズにはできません。 | ||||||||||||||||||||||||||||||
| cyMinChild | DWORD | 4 | +52 | +40 | 子ウィンドウの最小の高さ (ピクセル単位)。バンドはこの値より小さいサイズにはできません。 | ||||||||||||||||||||||||||||||
| cx | DWORD | 4 | +56 | +44 | バンドの長さ (ピクセル単位)。 | ||||||||||||||||||||||||||||||
| hbmBack | HBITMAP | 8/4 | +64 | +48 | このバンドの背景として使用されるビットマップのハンドルです。 | ||||||||||||||||||||||||||||||
| wID | DWORD | 4 | +72 | +52 | カスタム描画の通知メッセージでこのバンドを識別するために、コントロールが使用する UINT 値です。 | ||||||||||||||||||||||||||||||
| cyChild | DWORD | 4 | +76 | +56 | Version 4.71。バンドの初期の高さ (ピクセル単位)。RBBS_VARIABLEHEIGHT スタイルを指定しない限り、このメンバーは無視されます。 | ||||||||||||||||||||||||||||||
| cyMaxChild | DWORD | 4 | +80 | +60 | Version 4.71。バンドの最大の高さ (ピクセル単位)。RBBS_VARIABLEHEIGHT スタイルを指定しない限り、このメンバーは無視されます。 | ||||||||||||||||||||||||||||||
| cyIntegral | DWORD | 4 | +84 | +64 | Version 4.71。バンドを拡大または縮小する際のステップ値 (ピクセル単位)。バンドのサイズを変更する場合、この値で指定されたステップ単位でサイズが変更されます。RBBS_VARIABLEHEIGHT スタイルを指定しない限り、このメンバーは無視されます。 | ||||||||||||||||||||||||||||||
| cxIdeal | DWORD | 4 | +88 | +68 | Version 4.71。バンドの理想的な幅 (ピクセル単位)。バンドが理想的な幅まで最大化されると (RB_MAXIMIZEBAND を参照)、rebar コントロールはバンドをこの幅にしようとします。 | ||||||||||||||||||||||||||||||
| lParam | LPARAM | 8/4 | +96 | +72 | Version 4.71。アプリケーション定義の値です。 | ||||||||||||||||||||||||||||||
| cxHeader | DWORD | 4 | +104 | +76 | Version 4.71。バンドのヘッダーのサイズ (ピクセル単位)。バンドのヘッダーとは、バンドの端と子ウィンドウの端との間の領域です。バンドのテキストや画像が指定されている場合、それらはこの領域に表示されます。この値を指定すると、コントロールがバンドに対して計算する通常のヘッダーの寸法よりも優先されます。 | ||||||||||||||||||||||||||||||
| rcChevronLocation | RECT | 16 | +108 | +80 | Version 6。シェブロンの位置です。 | ||||||||||||||||||||||||||||||
| uChevronState | DWORD | 4 | +124 | +96 | Version 6。Object State Constants の組み合わせです。 |
公式ドキュメント
rebar コントロール内のバンドを定義する情報を格納します。
解説(Remarks)
cxMinChild、cyMinChild、cx の各メンバーは、コントロールの向きを基準とした寸法の情報を表します。つまり、水平方向の rebar コントロールでは、cxMinChild と cx は水平方向の寸法であり、cyMinChild は垂直方向の寸法です。ただし、コントロールが CCS_VERT スタイルを使用している場合は、cxMinChild と cx が垂直方向の寸法となり、cyMinChild が水平方向の寸法となります。
commctrl.h ヘッダーは、UNICODE プリプロセッサ定数の定義に応じて、この関数の ANSI 版と Unicode 版を自動的に選択するエイリアスとして REBARBANDINFO を定義しています。エンコーディングに依存しないエイリアスと、エンコーディングに依存するコードを混在させると、不一致が生じてコンパイル エラーや実行時エラーの原因となる可能性があります。詳細については、「Conventions for Function Prototypes」を参照してください。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// RECT (x64 16 / x86 16 バイト)
typedef struct RECT {
INT left;
INT top;
INT right;
INT bottom;
} RECT;
// REBARBANDINFOW (x64 128 / x86 100 バイト)
typedef struct REBARBANDINFOW {
DWORD cbSize;
DWORD fMask;
DWORD fStyle;
COLORREF clrFore;
COLORREF clrBack;
LPWSTR lpText;
DWORD cch;
INT iImage;
HWND hwndChild;
DWORD cxMinChild;
DWORD cyMinChild;
DWORD cx;
HBITMAP hbmBack;
DWORD wID;
DWORD cyChild;
DWORD cyMaxChild;
DWORD cyIntegral;
DWORD cxIdeal;
LPARAM lParam;
DWORD cxHeader;
RECT rcChevronLocation;
DWORD uChevronState;
} REBARBANDINFOW;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RECT
{
public int left;
public int top;
public int right;
public int bottom;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct REBARBANDINFOW
{
public uint cbSize;
public uint fMask;
public uint fStyle;
public uint clrFore;
public uint clrBack;
public IntPtr lpText;
public uint cch;
public int iImage;
public IntPtr hwndChild;
public uint cxMinChild;
public uint cyMinChild;
public uint cx;
public IntPtr hbmBack;
public uint wID;
public uint cyChild;
public uint cyMaxChild;
public uint cyIntegral;
public uint cxIdeal;
public IntPtr lParam;
public uint cxHeader;
public RECT rcChevronLocation;
public uint uChevronState;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RECT
Public left As Integer
Public top As Integer
Public right As Integer
Public bottom As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure REBARBANDINFOW
Public cbSize As UInteger
Public fMask As UInteger
Public fStyle As UInteger
Public clrFore As UInteger
Public clrBack As UInteger
Public lpText As IntPtr
Public cch As UInteger
Public iImage As Integer
Public hwndChild As IntPtr
Public cxMinChild As UInteger
Public cyMinChild As UInteger
Public cx As UInteger
Public hbmBack As IntPtr
Public wID As UInteger
Public cyChild As UInteger
Public cyMaxChild As UInteger
Public cyIntegral As UInteger
Public cxIdeal As UInteger
Public lParam As IntPtr
Public cxHeader As UInteger
Public rcChevronLocation As RECT
Public uChevronState As UInteger
End Structureimport ctypes
from ctypes import wintypes
class RECT(ctypes.Structure):
_fields_ = [
("left", ctypes.c_int),
("top", ctypes.c_int),
("right", ctypes.c_int),
("bottom", ctypes.c_int),
]
class REBARBANDINFOW(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("fMask", wintypes.DWORD),
("fStyle", wintypes.DWORD),
("clrFore", wintypes.DWORD),
("clrBack", wintypes.DWORD),
("lpText", ctypes.c_void_p),
("cch", wintypes.DWORD),
("iImage", ctypes.c_int),
("hwndChild", ctypes.c_void_p),
("cxMinChild", wintypes.DWORD),
("cyMinChild", wintypes.DWORD),
("cx", wintypes.DWORD),
("hbmBack", ctypes.c_void_p),
("wID", wintypes.DWORD),
("cyChild", wintypes.DWORD),
("cyMaxChild", wintypes.DWORD),
("cyIntegral", wintypes.DWORD),
("cxIdeal", wintypes.DWORD),
("lParam", ctypes.c_ssize_t),
("cxHeader", wintypes.DWORD),
("rcChevronLocation", RECT),
("uChevronState", wintypes.DWORD),
]#[repr(C)]
pub struct RECT {
pub left: i32,
pub top: i32,
pub right: i32,
pub bottom: i32,
}
#[repr(C)]
pub struct REBARBANDINFOW {
pub cbSize: u32,
pub fMask: u32,
pub fStyle: u32,
pub clrFore: u32,
pub clrBack: u32,
pub lpText: *mut core::ffi::c_void,
pub cch: u32,
pub iImage: i32,
pub hwndChild: *mut core::ffi::c_void,
pub cxMinChild: u32,
pub cyMinChild: u32,
pub cx: u32,
pub hbmBack: *mut core::ffi::c_void,
pub wID: u32,
pub cyChild: u32,
pub cyMaxChild: u32,
pub cyIntegral: u32,
pub cxIdeal: u32,
pub lParam: isize,
pub cxHeader: u32,
pub rcChevronLocation: RECT,
pub uChevronState: u32,
}import "golang.org/x/sys/windows"
type RECT struct {
left int32
top int32
right int32
bottom int32
}
type REBARBANDINFOW struct {
cbSize uint32
fMask uint32
fStyle uint32
clrFore uint32
clrBack uint32
lpText uintptr
cch uint32
iImage int32
hwndChild uintptr
cxMinChild uint32
cyMinChild uint32
cx uint32
hbmBack uintptr
wID uint32
cyChild uint32
cyMaxChild uint32
cyIntegral uint32
cxIdeal uint32
lParam uintptr
cxHeader uint32
rcChevronLocation RECT
uChevronState uint32
}type
RECT = record
left: Integer;
top: Integer;
right: Integer;
bottom: Integer;
end;
REBARBANDINFOW = record
cbSize: DWORD;
fMask: DWORD;
fStyle: DWORD;
clrFore: DWORD;
clrBack: DWORD;
lpText: Pointer;
cch: DWORD;
iImage: Integer;
hwndChild: Pointer;
cxMinChild: DWORD;
cyMinChild: DWORD;
cx: DWORD;
hbmBack: Pointer;
wID: DWORD;
cyChild: DWORD;
cyMaxChild: DWORD;
cyIntegral: DWORD;
cxIdeal: DWORD;
lParam: NativeInt;
cxHeader: DWORD;
rcChevronLocation: RECT;
uChevronState: DWORD;
end;const RECT = extern struct {
left: i32,
top: i32,
right: i32,
bottom: i32,
};
const REBARBANDINFOW = extern struct {
cbSize: u32,
fMask: u32,
fStyle: u32,
clrFore: u32,
clrBack: u32,
lpText: ?*anyopaque,
cch: u32,
iImage: i32,
hwndChild: ?*anyopaque,
cxMinChild: u32,
cyMinChild: u32,
cx: u32,
hbmBack: ?*anyopaque,
wID: u32,
cyChild: u32,
cyMaxChild: u32,
cyIntegral: u32,
cxIdeal: u32,
lParam: isize,
cxHeader: u32,
rcChevronLocation: RECT,
uChevronState: u32,
};type
RECT {.bycopy.} = object
left: int32
top: int32
right: int32
bottom: int32
REBARBANDINFOW {.bycopy.} = object
cbSize: uint32
fMask: uint32
fStyle: uint32
clrFore: uint32
clrBack: uint32
lpText: pointer
cch: uint32
iImage: int32
hwndChild: pointer
cxMinChild: uint32
cyMinChild: uint32
cx: uint32
hbmBack: pointer
wID: uint32
cyChild: uint32
cyMaxChild: uint32
cyIntegral: uint32
cxIdeal: uint32
lParam: int
cxHeader: uint32
rcChevronLocation: RECT
uChevronState: uint32struct RECT
{
int left;
int top;
int right;
int bottom;
}
struct REBARBANDINFOW
{
uint cbSize;
uint fMask;
uint fStyle;
uint clrFore;
uint clrBack;
void* lpText;
uint cch;
int iImage;
void* hwndChild;
uint cxMinChild;
uint cyMinChild;
uint cx;
void* hbmBack;
uint wID;
uint cyChild;
uint cyMaxChild;
uint cyIntegral;
uint cxIdeal;
ptrdiff_t lParam;
uint cxHeader;
RECT rcChevronLocation;
uint uChevronState;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; REBARBANDINFOW サイズ: 100 バイト(x86)
dim st, 25 ; 4byte整数×25(構造体サイズ 100 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; fMask : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; fStyle : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; clrFore : COLORREF (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; clrBack : COLORREF (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; lpText : LPWSTR (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; cch : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; iImage : INT (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; hwndChild : HWND (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; cxMinChild : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; cyMinChild : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; cx : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; hbmBack : HBITMAP (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; wID : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; cyChild : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; cyMaxChild : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; cyIntegral : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; cxIdeal : DWORD (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; lParam : LPARAM (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; cxHeader : DWORD (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; rcChevronLocation : RECT (+80, 16byte) varptr(st)+80 を基点に操作(16byte:入れ子/配列)
; uChevronState : DWORD (+96, 4byte) st.24 = 値 / 値 = st.24 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; REBARBANDINFOW サイズ: 128 バイト(x64)
dim st, 32 ; 4byte整数×32(構造体サイズ 128 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; fMask : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; fStyle : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; clrFore : COLORREF (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; clrBack : COLORREF (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; lpText : LPWSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; cch : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; iImage : INT (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; hwndChild : HWND (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; cxMinChild : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; cyMinChild : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; cx : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; hbmBack : HBITMAP (+64, 8byte) qpoke st,64,値 / qpeek(st,64) ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; wID : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; cyChild : DWORD (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; cyMaxChild : DWORD (+80, 4byte) st.20 = 値 / 値 = st.20 (lpoke/lpeek も可)
; cyIntegral : DWORD (+84, 4byte) st.21 = 値 / 値 = st.21 (lpoke/lpeek も可)
; cxIdeal : DWORD (+88, 4byte) st.22 = 値 / 値 = st.22 (lpoke/lpeek も可)
; lParam : LPARAM (+96, 8byte) qpoke st,96,値 / qpeek(st,96) ※IronHSPのみ。3.7/3.8は lpoke st,96,下位 : lpoke st,100,上位
; cxHeader : DWORD (+104, 4byte) st.26 = 値 / 値 = st.26 (lpoke/lpeek も可)
; rcChevronLocation : RECT (+108, 16byte) varptr(st)+108 を基点に操作(16byte:入れ子/配列)
; uChevronState : DWORD (+124, 4byte) st.31 = 値 / 値 = st.31 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global RECT
#field int left
#field int top
#field int right
#field int bottom
#endstruct
#defstruct global REBARBANDINFOW
#field int cbSize
#field int fMask
#field int fStyle
#field int clrFore
#field int clrBack
#field intptr lpText
#field int cch
#field int iImage
#field intptr hwndChild
#field int cxMinChild
#field int cyMinChild
#field int cx
#field intptr hbmBack
#field int wID
#field int cyChild
#field int cyMaxChild
#field int cyIntegral
#field int cxIdeal
#field intptr lParam
#field int cxHeader
#field RECT rcChevronLocation
#field int uChevronState
#endstruct
stdim st, REBARBANDINFOW ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize