ホーム › UI.Controls › CCSTYLEA
CCSTYLEA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| flStyle | DWORD | 4 | +0 | +0 | コントロールのウィンドウスタイル(WS_*など)。 |
| flExtStyle | DWORD | 4 | +4 | +4 | コントロールの拡張ウィンドウスタイル(WS_EX_*)。 |
| szText | CHAR | 256 | +8 | +8 | コントロールに表示するテキスト(ANSI固定長バッファ)。 |
| lgid | WORD | 2 | +264 | +264 | 言語識別子(LANGID)。 |
| wReserved1 | WORD | 2 | +266 | +266 | 予約済み。使用しない。 |
各言語での定義
#include <windows.h>
// CCSTYLEA (x64 268 / x86 268 バイト)
typedef struct CCSTYLEA {
DWORD flStyle;
DWORD flExtStyle;
CHAR szText[256];
WORD lgid;
WORD wReserved1;
} CCSTYLEA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CCSTYLEA
{
public uint flStyle;
public uint flExtStyle;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] public sbyte[] szText;
public ushort lgid;
public ushort wReserved1;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CCSTYLEA
Public flStyle As UInteger
Public flExtStyle As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=256)> Public szText() As SByte
Public lgid As UShort
Public wReserved1 As UShort
End Structureimport ctypes
from ctypes import wintypes
class CCSTYLEA(ctypes.Structure):
_fields_ = [
("flStyle", wintypes.DWORD),
("flExtStyle", wintypes.DWORD),
("szText", ctypes.c_byte * 256),
("lgid", ctypes.c_ushort),
("wReserved1", ctypes.c_ushort),
]#[repr(C)]
pub struct CCSTYLEA {
pub flStyle: u32,
pub flExtStyle: u32,
pub szText: [i8; 256],
pub lgid: u16,
pub wReserved1: u16,
}import "golang.org/x/sys/windows"
type CCSTYLEA struct {
flStyle uint32
flExtStyle uint32
szText [256]int8
lgid uint16
wReserved1 uint16
}type
CCSTYLEA = record
flStyle: DWORD;
flExtStyle: DWORD;
szText: array[0..255] of Shortint;
lgid: Word;
wReserved1: Word;
end;const CCSTYLEA = extern struct {
flStyle: u32,
flExtStyle: u32,
szText: [256]i8,
lgid: u16,
wReserved1: u16,
};type
CCSTYLEA {.bycopy.} = object
flStyle: uint32
flExtStyle: uint32
szText: array[256, int8]
lgid: uint16
wReserved1: uint16struct CCSTYLEA
{
uint flStyle;
uint flExtStyle;
byte[256] szText;
ushort lgid;
ushort wReserved1;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CCSTYLEA サイズ: 268 バイト(x64)
dim st, 67 ; 4byte整数×67(構造体サイズ 268 / 4 切り上げ)
; flStyle : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; flExtStyle : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; szText : CHAR (+8, 256byte) varptr(st)+8 を基点に操作(256byte:入れ子/配列)
; lgid : WORD (+264, 2byte) wpoke st,264,値 / 値 = wpeek(st,264)
; wReserved1 : WORD (+266, 2byte) wpoke st,266,値 / 値 = wpeek(st,266)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CCSTYLEA
#field int flStyle
#field int flExtStyle
#field byte szText 256
#field short lgid
#field short wReserved1
#endstruct
stdim st, CCSTYLEA ; NSTRUCT 変数を確保
st->flStyle = 100
mes "flStyle=" + st->flStyle