Win32 API 日本語リファレンス
ホームUI.Controls › LVGROUP

LVGROUP

構造体
サイズx64: 152 バイト / x86: 96 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
cbSizeDWORD4+0+0この構造体のサイズをバイト単位で指定する。
maskLVGROUP_MASK4+4+4有効なメンバーを示すLVGF_系マスクフラグの組み合わせ。
pszHeaderLPWSTR8/4+8+8グループのヘッダテキストへのポインタ。
cchHeaderINT4+16+12pszHeaderバッファの文字数。
pszFooterLPWSTR8/4+24+16グループのフッタテキストへのポインタ。
cchFooterINT4+32+20pszFooterバッファの文字数。
iGroupIdINT4+36+24グループの一意な識別子。
stateMaskLIST_VIEW_GROUP_STATE_FLAGS4+40+28stateのうち有効なビットを示すマスク。
stateLIST_VIEW_GROUP_STATE_FLAGS4+44+32グループの状態を示すLVGS_系フラグ。折りたたみ/選択等を表す。
uAlignLIST_VIEW_GROUP_ALIGN_FLAGS4+48+36ヘッダやフッタの配置を示すLVGA_系フラグ。
pszSubtitleLPWSTR8/4+56+40グループのサブタイトルテキストへのポインタ。
cchSubtitleDWORD4+64+44pszSubtitleバッファの文字数。
pszTaskLPWSTR8/4+72+48グループのタスクリンクテキストへのポインタ。
cchTaskDWORD4+80+52pszTaskバッファの文字数。
pszDescriptionTopLPWSTR8/4+88+56グループ上部の説明テキストへのポインタ。
cchDescriptionTopDWORD4+96+60pszDescriptionTopバッファの文字数。
pszDescriptionBottomLPWSTR8/4+104+64グループ下部の説明テキストへのポインタ。
cchDescriptionBottomDWORD4+112+68pszDescriptionBottomバッファの文字数。
iTitleImageINT4+116+72ヘッダタイトルに表示する画像のインデックス。
iExtendedImageINT4+120+76拡張イメージリストの画像インデックス。
iFirstItemINT4+124+80グループ内の先頭項目のインデックス(読み取り専用)。
cItemsDWORD4+128+84グループ内の項目数(読み取り専用)。
pszSubsetTitleLPWSTR8/4+136+88サブセットリンクのタイトルテキストへのポインタ。
cchSubsetTitleDWORD4+144+92pszSubsetTitleバッファの文字数。

各言語での定義

#include <windows.h>

// LVGROUP  (x64 152 / x86 96 バイト)
typedef struct LVGROUP {
    DWORD cbSize;
    LVGROUP_MASK mask;
    LPWSTR pszHeader;
    INT cchHeader;
    LPWSTR pszFooter;
    INT cchFooter;
    INT iGroupId;
    LIST_VIEW_GROUP_STATE_FLAGS stateMask;
    LIST_VIEW_GROUP_STATE_FLAGS state;
    LIST_VIEW_GROUP_ALIGN_FLAGS uAlign;
    LPWSTR pszSubtitle;
    DWORD cchSubtitle;
    LPWSTR pszTask;
    DWORD cchTask;
    LPWSTR pszDescriptionTop;
    DWORD cchDescriptionTop;
    LPWSTR pszDescriptionBottom;
    DWORD cchDescriptionBottom;
    INT iTitleImage;
    INT iExtendedImage;
    INT iFirstItem;
    DWORD cItems;
    LPWSTR pszSubsetTitle;
    DWORD cchSubsetTitle;
} LVGROUP;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct LVGROUP
{
    public uint cbSize;
    public uint mask;
    public IntPtr pszHeader;
    public int cchHeader;
    public IntPtr pszFooter;
    public int cchFooter;
    public int iGroupId;
    public uint stateMask;
    public uint state;
    public uint uAlign;
    public IntPtr pszSubtitle;
    public uint cchSubtitle;
    public IntPtr pszTask;
    public uint cchTask;
    public IntPtr pszDescriptionTop;
    public uint cchDescriptionTop;
    public IntPtr pszDescriptionBottom;
    public uint cchDescriptionBottom;
    public int iTitleImage;
    public int iExtendedImage;
    public int iFirstItem;
    public uint cItems;
    public IntPtr pszSubsetTitle;
    public uint cchSubsetTitle;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure LVGROUP
    Public cbSize As UInteger
    Public mask As UInteger
    Public pszHeader As IntPtr
    Public cchHeader As Integer
    Public pszFooter As IntPtr
    Public cchFooter As Integer
    Public iGroupId As Integer
    Public stateMask As UInteger
    Public state As UInteger
    Public uAlign As UInteger
    Public pszSubtitle As IntPtr
    Public cchSubtitle As UInteger
    Public pszTask As IntPtr
    Public cchTask As UInteger
    Public pszDescriptionTop As IntPtr
    Public cchDescriptionTop As UInteger
    Public pszDescriptionBottom As IntPtr
    Public cchDescriptionBottom As UInteger
    Public iTitleImage As Integer
    Public iExtendedImage As Integer
    Public iFirstItem As Integer
    Public cItems As UInteger
    Public pszSubsetTitle As IntPtr
    Public cchSubsetTitle As UInteger
End Structure
import ctypes
from ctypes import wintypes

class LVGROUP(ctypes.Structure):
    _fields_ = [
        ("cbSize", wintypes.DWORD),
        ("mask", wintypes.DWORD),
        ("pszHeader", ctypes.c_void_p),
        ("cchHeader", ctypes.c_int),
        ("pszFooter", ctypes.c_void_p),
        ("cchFooter", ctypes.c_int),
        ("iGroupId", ctypes.c_int),
        ("stateMask", wintypes.DWORD),
        ("state", wintypes.DWORD),
        ("uAlign", wintypes.DWORD),
        ("pszSubtitle", ctypes.c_void_p),
        ("cchSubtitle", wintypes.DWORD),
        ("pszTask", ctypes.c_void_p),
        ("cchTask", wintypes.DWORD),
        ("pszDescriptionTop", ctypes.c_void_p),
        ("cchDescriptionTop", wintypes.DWORD),
        ("pszDescriptionBottom", ctypes.c_void_p),
        ("cchDescriptionBottom", wintypes.DWORD),
        ("iTitleImage", ctypes.c_int),
        ("iExtendedImage", ctypes.c_int),
        ("iFirstItem", ctypes.c_int),
        ("cItems", wintypes.DWORD),
        ("pszSubsetTitle", ctypes.c_void_p),
        ("cchSubsetTitle", wintypes.DWORD),
    ]
#[repr(C)]
pub struct LVGROUP {
    pub cbSize: u32,
    pub mask: u32,
    pub pszHeader: *mut core::ffi::c_void,
    pub cchHeader: i32,
    pub pszFooter: *mut core::ffi::c_void,
    pub cchFooter: i32,
    pub iGroupId: i32,
    pub stateMask: u32,
    pub state: u32,
    pub uAlign: u32,
    pub pszSubtitle: *mut core::ffi::c_void,
    pub cchSubtitle: u32,
    pub pszTask: *mut core::ffi::c_void,
    pub cchTask: u32,
    pub pszDescriptionTop: *mut core::ffi::c_void,
    pub cchDescriptionTop: u32,
    pub pszDescriptionBottom: *mut core::ffi::c_void,
    pub cchDescriptionBottom: u32,
    pub iTitleImage: i32,
    pub iExtendedImage: i32,
    pub iFirstItem: i32,
    pub cItems: u32,
    pub pszSubsetTitle: *mut core::ffi::c_void,
    pub cchSubsetTitle: u32,
}
import "golang.org/x/sys/windows"

type LVGROUP struct {
	cbSize uint32
	mask uint32
	pszHeader uintptr
	cchHeader int32
	pszFooter uintptr
	cchFooter int32
	iGroupId int32
	stateMask uint32
	state uint32
	uAlign uint32
	pszSubtitle uintptr
	cchSubtitle uint32
	pszTask uintptr
	cchTask uint32
	pszDescriptionTop uintptr
	cchDescriptionTop uint32
	pszDescriptionBottom uintptr
	cchDescriptionBottom uint32
	iTitleImage int32
	iExtendedImage int32
	iFirstItem int32
	cItems uint32
	pszSubsetTitle uintptr
	cchSubsetTitle uint32
}
type
  LVGROUP = record
    cbSize: DWORD;
    mask: DWORD;
    pszHeader: Pointer;
    cchHeader: Integer;
    pszFooter: Pointer;
    cchFooter: Integer;
    iGroupId: Integer;
    stateMask: DWORD;
    state: DWORD;
    uAlign: DWORD;
    pszSubtitle: Pointer;
    cchSubtitle: DWORD;
    pszTask: Pointer;
    cchTask: DWORD;
    pszDescriptionTop: Pointer;
    cchDescriptionTop: DWORD;
    pszDescriptionBottom: Pointer;
    cchDescriptionBottom: DWORD;
    iTitleImage: Integer;
    iExtendedImage: Integer;
    iFirstItem: Integer;
    cItems: DWORD;
    pszSubsetTitle: Pointer;
    cchSubsetTitle: DWORD;
  end;
const LVGROUP = extern struct {
    cbSize: u32,
    mask: u32,
    pszHeader: ?*anyopaque,
    cchHeader: i32,
    pszFooter: ?*anyopaque,
    cchFooter: i32,
    iGroupId: i32,
    stateMask: u32,
    state: u32,
    uAlign: u32,
    pszSubtitle: ?*anyopaque,
    cchSubtitle: u32,
    pszTask: ?*anyopaque,
    cchTask: u32,
    pszDescriptionTop: ?*anyopaque,
    cchDescriptionTop: u32,
    pszDescriptionBottom: ?*anyopaque,
    cchDescriptionBottom: u32,
    iTitleImage: i32,
    iExtendedImage: i32,
    iFirstItem: i32,
    cItems: u32,
    pszSubsetTitle: ?*anyopaque,
    cchSubsetTitle: u32,
};
type
  LVGROUP {.bycopy.} = object
    cbSize: uint32
    mask: uint32
    pszHeader: pointer
    cchHeader: int32
    pszFooter: pointer
    cchFooter: int32
    iGroupId: int32
    stateMask: uint32
    state: uint32
    uAlign: uint32
    pszSubtitle: pointer
    cchSubtitle: uint32
    pszTask: pointer
    cchTask: uint32
    pszDescriptionTop: pointer
    cchDescriptionTop: uint32
    pszDescriptionBottom: pointer
    cchDescriptionBottom: uint32
    iTitleImage: int32
    iExtendedImage: int32
    iFirstItem: int32
    cItems: uint32
    pszSubsetTitle: pointer
    cchSubsetTitle: uint32
struct LVGROUP
{
    uint cbSize;
    uint mask;
    void* pszHeader;
    int cchHeader;
    void* pszFooter;
    int cchFooter;
    int iGroupId;
    uint stateMask;
    uint state;
    uint uAlign;
    void* pszSubtitle;
    uint cchSubtitle;
    void* pszTask;
    uint cchTask;
    void* pszDescriptionTop;
    uint cchDescriptionTop;
    void* pszDescriptionBottom;
    uint cchDescriptionBottom;
    int iTitleImage;
    int iExtendedImage;
    int iFirstItem;
    uint cItems;
    void* pszSubsetTitle;
    uint cchSubsetTitle;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; LVGROUP サイズ: 96 バイト(x86)
dim st, 24    ; 4byte整数×24(構造体サイズ 96 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; mask : LVGROUP_MASK (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; pszHeader : LPWSTR (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; cchHeader : INT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; pszFooter : LPWSTR (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; cchFooter : INT (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; iGroupId : INT (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; stateMask : LIST_VIEW_GROUP_STATE_FLAGS (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; state : LIST_VIEW_GROUP_STATE_FLAGS (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; uAlign : LIST_VIEW_GROUP_ALIGN_FLAGS (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; pszSubtitle : LPWSTR (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; cchSubtitle : DWORD (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; pszTask : LPWSTR (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; cchTask : DWORD (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; pszDescriptionTop : LPWSTR (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; cchDescriptionTop : DWORD (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; pszDescriptionBottom : LPWSTR (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; cchDescriptionBottom : DWORD (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; iTitleImage : INT (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; iExtendedImage : INT (+76, 4byte)  st.19 = 値  /  値 = st.19   (lpoke/lpeek も可)
; iFirstItem : INT (+80, 4byte)  st.20 = 値  /  値 = st.20   (lpoke/lpeek も可)
; cItems : DWORD (+84, 4byte)  st.21 = 値  /  値 = st.21   (lpoke/lpeek も可)
; pszSubsetTitle : LPWSTR (+88, 4byte)  st.22 = 値  /  値 = st.22   (lpoke/lpeek も可)
; cchSubsetTitle : DWORD (+92, 4byte)  st.23 = 値  /  値 = st.23   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; LVGROUP サイズ: 152 バイト(x64)
dim st, 38    ; 4byte整数×38(構造体サイズ 152 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; mask : LVGROUP_MASK (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; pszHeader : LPWSTR (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; cchHeader : INT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; pszFooter : LPWSTR (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; cchFooter : INT (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; iGroupId : INT (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; stateMask : LIST_VIEW_GROUP_STATE_FLAGS (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; state : LIST_VIEW_GROUP_STATE_FLAGS (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; uAlign : LIST_VIEW_GROUP_ALIGN_FLAGS (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; pszSubtitle : LPWSTR (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; cchSubtitle : DWORD (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; pszTask : LPWSTR (+72, 8byte)  qpoke st,72,値 / qpeek(st,72)  ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; cchTask : DWORD (+80, 4byte)  st.20 = 値  /  値 = st.20   (lpoke/lpeek も可)
; pszDescriptionTop : LPWSTR (+88, 8byte)  qpoke st,88,値 / qpeek(st,88)  ※IronHSPのみ。3.7/3.8は lpoke st,88,下位 : lpoke st,92,上位
; cchDescriptionTop : DWORD (+96, 4byte)  st.24 = 値  /  値 = st.24   (lpoke/lpeek も可)
; pszDescriptionBottom : LPWSTR (+104, 8byte)  qpoke st,104,値 / qpeek(st,104)  ※IronHSPのみ。3.7/3.8は lpoke st,104,下位 : lpoke st,108,上位
; cchDescriptionBottom : DWORD (+112, 4byte)  st.28 = 値  /  値 = st.28   (lpoke/lpeek も可)
; iTitleImage : INT (+116, 4byte)  st.29 = 値  /  値 = st.29   (lpoke/lpeek も可)
; iExtendedImage : INT (+120, 4byte)  st.30 = 値  /  値 = st.30   (lpoke/lpeek も可)
; iFirstItem : INT (+124, 4byte)  st.31 = 値  /  値 = st.31   (lpoke/lpeek も可)
; cItems : DWORD (+128, 4byte)  st.32 = 値  /  値 = st.32   (lpoke/lpeek も可)
; pszSubsetTitle : LPWSTR (+136, 8byte)  qpoke st,136,値 / qpeek(st,136)  ※IronHSPのみ。3.7/3.8は lpoke st,136,下位 : lpoke st,140,上位
; cchSubsetTitle : DWORD (+144, 4byte)  st.36 = 値  /  値 = st.36   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global LVGROUP
    #field int cbSize
    #field int mask
    #field intptr pszHeader
    #field int cchHeader
    #field intptr pszFooter
    #field int cchFooter
    #field int iGroupId
    #field int stateMask
    #field int state
    #field int uAlign
    #field intptr pszSubtitle
    #field int cchSubtitle
    #field intptr pszTask
    #field int cchTask
    #field intptr pszDescriptionTop
    #field int cchDescriptionTop
    #field intptr pszDescriptionBottom
    #field int cchDescriptionBottom
    #field int iTitleImage
    #field int iExtendedImage
    #field int iFirstItem
    #field int cItems
    #field intptr pszSubsetTitle
    #field int cchSubsetTitle
#endstruct

stdim st, LVGROUP        ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize