DESKBANDINFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwMask | DWORD | 4 | +0 | +0 | 有効なメンバを示すマスク(DBIM_定数)。 |
| ptMinSize | POINTL | 8 | +4 | +4 | バンドの最小サイズ(POINTL)。 |
| ptMaxSize | POINTL | 8 | +12 | +12 | バンドの最大サイズ(POINTL)。 |
| ptIntegral | POINTL | 8 | +20 | +20 | サイズ変更時の刻み量(POINTL)。 |
| ptActual | POINTL | 8 | +28 | +28 | バンドの実際のサイズ(POINTL)。 |
| wszTitle | WCHAR | 512 | +36 | +36 | バンドのタイトル文字列(Unicode固定長配列)。 |
| dwModeFlags | DWORD | 4 | +548 | +548 | バンドの表示モードフラグ(DBIMF_定数)。 |
| crBkgnd | COLORREF | 4 | +552 | +552 | バンドの背景色(COLORREF)。DBIM_BKCOLOR時に使用。 |
各言語での定義
#include <windows.h>
// POINTL (x64 8 / x86 8 バイト)
typedef struct POINTL {
INT x;
INT y;
} POINTL;
// DESKBANDINFO (x64 556 / x86 556 バイト)
typedef struct DESKBANDINFO {
DWORD dwMask;
POINTL ptMinSize;
POINTL ptMaxSize;
POINTL ptIntegral;
POINTL ptActual;
WCHAR wszTitle[256];
DWORD dwModeFlags;
COLORREF crBkgnd;
} DESKBANDINFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct POINTL
{
public int x;
public int y;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DESKBANDINFO
{
public uint dwMask;
public POINTL ptMinSize;
public POINTL ptMaxSize;
public POINTL ptIntegral;
public POINTL ptActual;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string wszTitle;
public uint dwModeFlags;
public uint crBkgnd;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure POINTL
Public x As Integer
Public y As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DESKBANDINFO
Public dwMask As UInteger
Public ptMinSize As POINTL
Public ptMaxSize As POINTL
Public ptIntegral As POINTL
Public ptActual As POINTL
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=256)> Public wszTitle As String
Public dwModeFlags As UInteger
Public crBkgnd As UInteger
End Structureimport ctypes
from ctypes import wintypes
class POINTL(ctypes.Structure):
_fields_ = [
("x", ctypes.c_int),
("y", ctypes.c_int),
]
class DESKBANDINFO(ctypes.Structure):
_fields_ = [
("dwMask", wintypes.DWORD),
("ptMinSize", POINTL),
("ptMaxSize", POINTL),
("ptIntegral", POINTL),
("ptActual", POINTL),
("wszTitle", ctypes.c_wchar * 256),
("dwModeFlags", wintypes.DWORD),
("crBkgnd", wintypes.DWORD),
]#[repr(C)]
pub struct POINTL {
pub x: i32,
pub y: i32,
}
#[repr(C)]
pub struct DESKBANDINFO {
pub dwMask: u32,
pub ptMinSize: POINTL,
pub ptMaxSize: POINTL,
pub ptIntegral: POINTL,
pub ptActual: POINTL,
pub wszTitle: [u16; 256],
pub dwModeFlags: u32,
pub crBkgnd: u32,
}import "golang.org/x/sys/windows"
type POINTL struct {
x int32
y int32
}
type DESKBANDINFO struct {
dwMask uint32
ptMinSize POINTL
ptMaxSize POINTL
ptIntegral POINTL
ptActual POINTL
wszTitle [256]uint16
dwModeFlags uint32
crBkgnd uint32
}type
POINTL = record
x: Integer;
y: Integer;
end;
DESKBANDINFO = record
dwMask: DWORD;
ptMinSize: POINTL;
ptMaxSize: POINTL;
ptIntegral: POINTL;
ptActual: POINTL;
wszTitle: array[0..255] of WideChar;
dwModeFlags: DWORD;
crBkgnd: DWORD;
end;const POINTL = extern struct {
x: i32,
y: i32,
};
const DESKBANDINFO = extern struct {
dwMask: u32,
ptMinSize: POINTL,
ptMaxSize: POINTL,
ptIntegral: POINTL,
ptActual: POINTL,
wszTitle: [256]u16,
dwModeFlags: u32,
crBkgnd: u32,
};type
POINTL {.bycopy.} = object
x: int32
y: int32
DESKBANDINFO {.bycopy.} = object
dwMask: uint32
ptMinSize: POINTL
ptMaxSize: POINTL
ptIntegral: POINTL
ptActual: POINTL
wszTitle: array[256, uint16]
dwModeFlags: uint32
crBkgnd: uint32struct POINTL
{
int x;
int y;
}
struct DESKBANDINFO
{
uint dwMask;
POINTL ptMinSize;
POINTL ptMaxSize;
POINTL ptIntegral;
POINTL ptActual;
wchar[256] wszTitle;
uint dwModeFlags;
uint crBkgnd;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DESKBANDINFO サイズ: 556 バイト(x64)
dim st, 139 ; 4byte整数×139(構造体サイズ 556 / 4 切り上げ)
; dwMask : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; ptMinSize : POINTL (+4, 8byte) varptr(st)+4 を基点に操作(8byte:入れ子/配列)
; ptMaxSize : POINTL (+12, 8byte) varptr(st)+12 を基点に操作(8byte:入れ子/配列)
; ptIntegral : POINTL (+20, 8byte) varptr(st)+20 を基点に操作(8byte:入れ子/配列)
; ptActual : POINTL (+28, 8byte) varptr(st)+28 を基点に操作(8byte:入れ子/配列)
; wszTitle : WCHAR (+36, 512byte) varptr(st)+36 を基点に操作(512byte:入れ子/配列)
; dwModeFlags : DWORD (+548, 4byte) st.137 = 値 / 値 = st.137 (lpoke/lpeek も可)
; crBkgnd : COLORREF (+552, 4byte) st.138 = 値 / 値 = st.138 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global POINTL
#field int x
#field int y
#endstruct
#defstruct global DESKBANDINFO
#field int dwMask
#field POINTL ptMinSize
#field POINTL ptMaxSize
#field POINTL ptIntegral
#field POINTL ptActual
#field wchar wszTitle 256
#field int dwModeFlags
#field int crBkgnd
#endstruct
stdim st, DESKBANDINFO ; NSTRUCT 変数を確保
st->dwMask = 100
mes "dwMask=" + st->dwMask