ホーム › UI.Controls › LVCOLUMNW
LVCOLUMNW
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| mask | LVCOLUMNW_MASK | 4 | +0 | +0 | 有効なメンバーを示すLVCF_系マスクフラグの組み合わせ。 |
| fmt | LVCOLUMNW_FORMAT | 4 | +4 | +4 | 列の配置や画像表示を示すLVCFMT_系フラグ。 |
| cx | INT | 4 | +8 | +8 | 列の幅(ピクセル)。 |
| pszText | LPWSTR | 8/4 | +16 | +12 | 列ヘッダのテキストを保持するバッファへのポインタ。 |
| cchTextMax | INT | 4 | +24 | +16 | pszTextバッファの最大文字数。 |
| iSubItem | INT | 4 | +28 | +20 | この列に対応するサブ項目のインデックス。 |
| iImage | INT | 4 | +32 | +24 | 列ヘッダに表示するイメージのインデックス。 |
| iOrder | INT | 4 | +36 | +28 | 列の左から数えた表示順序。0始まり。 |
| cxMin | INT | 4 | +40 | +32 | 列の最小幅(ピクセル)。 |
| cxDefault | INT | 4 | +44 | +36 | 列の既定幅(ピクセル)。 |
| cxIdeal | INT | 4 | +48 | +40 | コンテンツに合う理想幅(ピクセル)。 |
各言語での定義
#include <windows.h>
// LVCOLUMNW (x64 56 / x86 44 バイト)
typedef struct LVCOLUMNW {
LVCOLUMNW_MASK mask;
LVCOLUMNW_FORMAT fmt;
INT cx;
LPWSTR pszText;
INT cchTextMax;
INT iSubItem;
INT iImage;
INT iOrder;
INT cxMin;
INT cxDefault;
INT cxIdeal;
} LVCOLUMNW;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct LVCOLUMNW
{
public uint mask;
public int fmt;
public int cx;
public IntPtr pszText;
public int cchTextMax;
public int iSubItem;
public int iImage;
public int iOrder;
public int cxMin;
public int cxDefault;
public int cxIdeal;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure LVCOLUMNW
Public mask As UInteger
Public fmt As Integer
Public cx As Integer
Public pszText As IntPtr
Public cchTextMax As Integer
Public iSubItem As Integer
Public iImage As Integer
Public iOrder As Integer
Public cxMin As Integer
Public cxDefault As Integer
Public cxIdeal As Integer
End Structureimport ctypes
from ctypes import wintypes
class LVCOLUMNW(ctypes.Structure):
_fields_ = [
("mask", wintypes.DWORD),
("fmt", ctypes.c_int),
("cx", ctypes.c_int),
("pszText", ctypes.c_void_p),
("cchTextMax", ctypes.c_int),
("iSubItem", ctypes.c_int),
("iImage", ctypes.c_int),
("iOrder", ctypes.c_int),
("cxMin", ctypes.c_int),
("cxDefault", ctypes.c_int),
("cxIdeal", ctypes.c_int),
]#[repr(C)]
pub struct LVCOLUMNW {
pub mask: u32,
pub fmt: i32,
pub cx: i32,
pub pszText: *mut core::ffi::c_void,
pub cchTextMax: i32,
pub iSubItem: i32,
pub iImage: i32,
pub iOrder: i32,
pub cxMin: i32,
pub cxDefault: i32,
pub cxIdeal: i32,
}import "golang.org/x/sys/windows"
type LVCOLUMNW struct {
mask uint32
fmt int32
cx int32
pszText uintptr
cchTextMax int32
iSubItem int32
iImage int32
iOrder int32
cxMin int32
cxDefault int32
cxIdeal int32
}type
LVCOLUMNW = record
mask: DWORD;
fmt: Integer;
cx: Integer;
pszText: Pointer;
cchTextMax: Integer;
iSubItem: Integer;
iImage: Integer;
iOrder: Integer;
cxMin: Integer;
cxDefault: Integer;
cxIdeal: Integer;
end;const LVCOLUMNW = extern struct {
mask: u32,
fmt: i32,
cx: i32,
pszText: ?*anyopaque,
cchTextMax: i32,
iSubItem: i32,
iImage: i32,
iOrder: i32,
cxMin: i32,
cxDefault: i32,
cxIdeal: i32,
};type
LVCOLUMNW {.bycopy.} = object
mask: uint32
fmt: int32
cx: int32
pszText: pointer
cchTextMax: int32
iSubItem: int32
iImage: int32
iOrder: int32
cxMin: int32
cxDefault: int32
cxIdeal: int32struct LVCOLUMNW
{
uint mask;
int fmt;
int cx;
void* pszText;
int cchTextMax;
int iSubItem;
int iImage;
int iOrder;
int cxMin;
int cxDefault;
int cxIdeal;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; LVCOLUMNW サイズ: 44 バイト(x86)
dim st, 11 ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; mask : LVCOLUMNW_MASK (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; fmt : LVCOLUMNW_FORMAT (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; cx : INT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; pszText : LPWSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; cchTextMax : INT (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; iSubItem : INT (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; iImage : INT (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; iOrder : INT (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; cxMin : INT (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; cxDefault : INT (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; cxIdeal : INT (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; LVCOLUMNW サイズ: 56 バイト(x64)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; mask : LVCOLUMNW_MASK (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; fmt : LVCOLUMNW_FORMAT (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; cx : INT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; pszText : LPWSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; cchTextMax : INT (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; iSubItem : INT (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; iImage : INT (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; iOrder : INT (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; cxMin : INT (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; cxDefault : INT (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; cxIdeal : INT (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global LVCOLUMNW
#field int mask
#field int fmt
#field int cx
#field intptr pszText
#field int cchTextMax
#field int iSubItem
#field int iImage
#field int iOrder
#field int cxMin
#field int cxDefault
#field int cxIdeal
#endstruct
stdim st, LVCOLUMNW ; NSTRUCT 変数を確保
st->mask = 100
mes "mask=" + st->mask