ホーム › UI.Controls › LVINSERTGROUPSORTED
LVINSERTGROUPSORTED
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| pfnGroupCompare | PFNLVGROUPCOMPARE | 8/4 | +0 | +0 | グループの挿入位置を決める比較コールバック関数へのポインタ。 |
| pvData | void* | 8/4 | +8 | +4 | 比較関数に渡されるアプリケーション定義データ。 |
| lvGroup | LVGROUP | 152/96 | +16 | +8 | 挿入するグループの情報を保持するLVGROUP構造体。 |
各言語での定義
#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;
// LVINSERTGROUPSORTED (x64 168 / x86 104 バイト)
typedef struct LVINSERTGROUPSORTED {
PFNLVGROUPCOMPARE pfnGroupCompare;
void* pvData;
LVGROUP lvGroup;
} LVINSERTGROUPSORTED;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;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct LVINSERTGROUPSORTED
{
public IntPtr pfnGroupCompare;
public IntPtr pvData;
public LVGROUP lvGroup;
}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
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure LVINSERTGROUPSORTED
Public pfnGroupCompare As IntPtr
Public pvData As IntPtr
Public lvGroup As LVGROUP
End Structureimport 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),
]
class LVINSERTGROUPSORTED(ctypes.Structure):
_fields_ = [
("pfnGroupCompare", ctypes.c_void_p),
("pvData", ctypes.c_void_p),
("lvGroup", LVGROUP),
]#[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,
}
#[repr(C)]
pub struct LVINSERTGROUPSORTED {
pub pfnGroupCompare: *mut core::ffi::c_void,
pub pvData: *mut core::ffi::c_void,
pub lvGroup: LVGROUP,
}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 LVINSERTGROUPSORTED struct {
pfnGroupCompare uintptr
pvData uintptr
lvGroup LVGROUP
}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;
LVINSERTGROUPSORTED = record
pfnGroupCompare: Pointer;
pvData: Pointer;
lvGroup: LVGROUP;
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,
};
const LVINSERTGROUPSORTED = extern struct {
pfnGroupCompare: ?*anyopaque,
pvData: ?*anyopaque,
lvGroup: LVGROUP,
};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
LVINSERTGROUPSORTED {.bycopy.} = object
pfnGroupCompare: pointer
pvData: pointer
lvGroup: LVGROUPstruct 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;
}
struct LVINSERTGROUPSORTED
{
void* pfnGroupCompare;
void* pvData;
LVGROUP lvGroup;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; LVINSERTGROUPSORTED サイズ: 104 バイト(x86)
dim st, 26 ; 4byte整数×26(構造体サイズ 104 / 4 切り上げ)
; pfnGroupCompare : PFNLVGROUPCOMPARE (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pvData : void* (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; lvGroup : LVGROUP (+8, 96byte) varptr(st)+8 を基点に操作(96byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; LVINSERTGROUPSORTED サイズ: 168 バイト(x64)
dim st, 42 ; 4byte整数×42(構造体サイズ 168 / 4 切り上げ)
; pfnGroupCompare : PFNLVGROUPCOMPARE (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; pvData : void* (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; lvGroup : LVGROUP (+16, 152byte) varptr(st)+16 を基点に操作(152byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#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
#defstruct global LVINSERTGROUPSORTED
#field intptr pfnGroupCompare
#field intptr pvData
#field LVGROUP lvGroup
#endstruct
stdim st, LVINSERTGROUPSORTED ; NSTRUCT 変数を確保