ホーム › System.Com › CATEGORYINFO
CATEGORYINFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| catid | GUID | 16 | +0 | +0 | コンポーネントカテゴリを識別するCATID。 |
| lcid | DWORD | 4 | +16 | +16 | 説明文(szDescription)の言語ロケールID。 |
| szDescription | WCHAR | 256 | +20 | +20 | カテゴリの説明を格納する固定長WCHARバッファ。 |
各言語での定義
#include <windows.h>
// CATEGORYINFO (x64 276 / x86 276 バイト)
typedef struct CATEGORYINFO {
GUID catid;
DWORD lcid;
WCHAR szDescription[128];
} CATEGORYINFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CATEGORYINFO
{
public Guid catid;
public uint lcid;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] public string szDescription;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CATEGORYINFO
Public catid As Guid
Public lcid As UInteger
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=128)> Public szDescription As String
End Structureimport ctypes
from ctypes import wintypes
class CATEGORYINFO(ctypes.Structure):
_fields_ = [
("catid", GUID),
("lcid", wintypes.DWORD),
("szDescription", ctypes.c_wchar * 128),
]#[repr(C)]
pub struct CATEGORYINFO {
pub catid: GUID,
pub lcid: u32,
pub szDescription: [u16; 128],
}import "golang.org/x/sys/windows"
type CATEGORYINFO struct {
catid windows.GUID
lcid uint32
szDescription [128]uint16
}type
CATEGORYINFO = record
catid: TGUID;
lcid: DWORD;
szDescription: array[0..127] of WideChar;
end;const CATEGORYINFO = extern struct {
catid: GUID,
lcid: u32,
szDescription: [128]u16,
};type
CATEGORYINFO {.bycopy.} = object
catid: GUID
lcid: uint32
szDescription: array[128, uint16]struct CATEGORYINFO
{
GUID catid;
uint lcid;
wchar[128] szDescription;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CATEGORYINFO サイズ: 276 バイト(x64)
dim st, 69 ; 4byte整数×69(構造体サイズ 276 / 4 切り上げ)
; catid : GUID (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; lcid : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; szDescription : WCHAR (+20, 256byte) varptr(st)+20 を基点に操作(256byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
#field int Data1
#field short Data2
#field short Data3
#field byte Data4 8
#endstruct
#defstruct global CATEGORYINFO
#field GUID catid
#field int lcid
#field wchar szDescription 128
#endstruct
stdim st, CATEGORYINFO ; NSTRUCT 変数を確保
st->lcid = 100
mes "lcid=" + st->lcid