ホーム › UI.Controls › CCSTYLEW
CCSTYLEW
構造体サイズ=各フィールドのバイト数(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 | WCHAR | 512 | +8 | +8 | コントロールに表示するテキスト(Unicode固定長バッファ)。 |
| lgid | WORD | 2 | +520 | +520 | 言語識別子(LANGID)。 |
| wReserved1 | WORD | 2 | +522 | +522 | 予約済み。使用しない。 |
各言語での定義
#include <windows.h>
// CCSTYLEW (x64 524 / x86 524 バイト)
typedef struct CCSTYLEW {
DWORD flStyle;
DWORD flExtStyle;
WCHAR szText[256];
WORD lgid;
WORD wReserved1;
} CCSTYLEW;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CCSTYLEW
{
public uint flStyle;
public uint flExtStyle;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string szText;
public ushort lgid;
public ushort wReserved1;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CCSTYLEW
Public flStyle As UInteger
Public flExtStyle As UInteger
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=256)> Public szText As String
Public lgid As UShort
Public wReserved1 As UShort
End Structureimport ctypes
from ctypes import wintypes
class CCSTYLEW(ctypes.Structure):
_fields_ = [
("flStyle", wintypes.DWORD),
("flExtStyle", wintypes.DWORD),
("szText", ctypes.c_wchar * 256),
("lgid", ctypes.c_ushort),
("wReserved1", ctypes.c_ushort),
]#[repr(C)]
pub struct CCSTYLEW {
pub flStyle: u32,
pub flExtStyle: u32,
pub szText: [u16; 256],
pub lgid: u16,
pub wReserved1: u16,
}import "golang.org/x/sys/windows"
type CCSTYLEW struct {
flStyle uint32
flExtStyle uint32
szText [256]uint16
lgid uint16
wReserved1 uint16
}type
CCSTYLEW = record
flStyle: DWORD;
flExtStyle: DWORD;
szText: array[0..255] of WideChar;
lgid: Word;
wReserved1: Word;
end;const CCSTYLEW = extern struct {
flStyle: u32,
flExtStyle: u32,
szText: [256]u16,
lgid: u16,
wReserved1: u16,
};type
CCSTYLEW {.bycopy.} = object
flStyle: uint32
flExtStyle: uint32
szText: array[256, uint16]
lgid: uint16
wReserved1: uint16struct CCSTYLEW
{
uint flStyle;
uint flExtStyle;
wchar[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 レイアウト)
; CCSTYLEW サイズ: 524 バイト(x64)
dim st, 131 ; 4byte整数×131(構造体サイズ 524 / 4 切り上げ)
; flStyle : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; flExtStyle : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; szText : WCHAR (+8, 512byte) varptr(st)+8 を基点に操作(512byte:入れ子/配列)
; lgid : WORD (+520, 2byte) wpoke st,520,値 / 値 = wpeek(st,520)
; wReserved1 : WORD (+522, 2byte) wpoke st,522,値 / 値 = wpeek(st,522)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CCSTYLEW
#field int flStyle
#field int flExtStyle
#field wchar szText 256
#field short lgid
#field short wReserved1
#endstruct
stdim st, CCSTYLEW ; NSTRUCT 変数を確保
st->flStyle = 100
mes "flStyle=" + st->flStyle