CM_COLUMNINFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | 構造体のサイズ (バイト単位)。 |
| dwMask | DWORD | 4 | +4 | +4 | この構造体のどのメンバーが有効かを指定する CM_MASK 列挙型の 1 つ以上の値。 |
| dwState | DWORD | 4 | +8 | +8 | 列の状態を指定する CM_STATE 列挙型の 1 つ以上の値。 |
| uWidth | DWORD | 4 | +12 | +12 | 列の幅を指定する CM_SET_WIDTH_VALUE 列挙型のメンバーの 1 つ。 |
| uDefaultWidth | DWORD | 4 | +16 | +16 | 列の既定の幅。 |
| uIdealWidth | DWORD | 4 | +20 | +20 | 列の理想的な幅。 |
| wszName | WCHAR | 160 | +24 | +24 | 列の名前を null 終端の Unicode 文字列として格納する、サイズ MAX_COLUMN_NAME_LEN のバッファー。 |
公式ドキュメント
列の情報を定義します。IColumnManager インターフェイスのメンバーで使用されます。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// CM_COLUMNINFO (x64 184 / x86 184 バイト)
typedef struct CM_COLUMNINFO {
DWORD cbSize;
DWORD dwMask;
DWORD dwState;
DWORD uWidth;
DWORD uDefaultWidth;
DWORD uIdealWidth;
WCHAR wszName[80];
} CM_COLUMNINFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CM_COLUMNINFO
{
public uint cbSize;
public uint dwMask;
public uint dwState;
public uint uWidth;
public uint uDefaultWidth;
public uint uIdealWidth;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)] public string wszName;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CM_COLUMNINFO
Public cbSize As UInteger
Public dwMask As UInteger
Public dwState As UInteger
Public uWidth As UInteger
Public uDefaultWidth As UInteger
Public uIdealWidth As UInteger
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=80)> Public wszName As String
End Structureimport ctypes
from ctypes import wintypes
class CM_COLUMNINFO(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("dwMask", wintypes.DWORD),
("dwState", wintypes.DWORD),
("uWidth", wintypes.DWORD),
("uDefaultWidth", wintypes.DWORD),
("uIdealWidth", wintypes.DWORD),
("wszName", ctypes.c_wchar * 80),
]#[repr(C)]
pub struct CM_COLUMNINFO {
pub cbSize: u32,
pub dwMask: u32,
pub dwState: u32,
pub uWidth: u32,
pub uDefaultWidth: u32,
pub uIdealWidth: u32,
pub wszName: [u16; 80],
}import "golang.org/x/sys/windows"
type CM_COLUMNINFO struct {
cbSize uint32
dwMask uint32
dwState uint32
uWidth uint32
uDefaultWidth uint32
uIdealWidth uint32
wszName [80]uint16
}type
CM_COLUMNINFO = record
cbSize: DWORD;
dwMask: DWORD;
dwState: DWORD;
uWidth: DWORD;
uDefaultWidth: DWORD;
uIdealWidth: DWORD;
wszName: array[0..79] of WideChar;
end;const CM_COLUMNINFO = extern struct {
cbSize: u32,
dwMask: u32,
dwState: u32,
uWidth: u32,
uDefaultWidth: u32,
uIdealWidth: u32,
wszName: [80]u16,
};type
CM_COLUMNINFO {.bycopy.} = object
cbSize: uint32
dwMask: uint32
dwState: uint32
uWidth: uint32
uDefaultWidth: uint32
uIdealWidth: uint32
wszName: array[80, uint16]struct CM_COLUMNINFO
{
uint cbSize;
uint dwMask;
uint dwState;
uint uWidth;
uint uDefaultWidth;
uint uIdealWidth;
wchar[80] wszName;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CM_COLUMNINFO サイズ: 184 バイト(x64)
dim st, 46 ; 4byte整数×46(構造体サイズ 184 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwMask : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwState : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; uWidth : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; uDefaultWidth : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; uIdealWidth : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; wszName : WCHAR (+24, 160byte) varptr(st)+24 を基点に操作(160byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CM_COLUMNINFO
#field int cbSize
#field int dwMask
#field int dwState
#field int uWidth
#field int uDefaultWidth
#field int uIdealWidth
#field wchar wszName 80
#endstruct
stdim st, CM_COLUMNINFO ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize