ホーム › UI.Controls › LVBKIMAGEA
LVBKIMAGEA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ulFlags | LIST_VIEW_BACKGROUND_IMAGE_FLAGS | 4 | +0 | +0 | 背景画像の種類や配置を示すLVBKIF_系フラグの組み合わせ。 |
| hbm | HBITMAP | 8/4 | +8 | +4 | 背景に使うビットマップのハンドル。LVBKIF_SOURCE_HBITMAP時に有効。 |
| pszImage | LPSTR | 8/4 | +16 | +8 | 背景画像のURLまたはパスへのポインタ。LVBKIF_SOURCE_URL時に有効。 |
| cchImageMax | DWORD | 4 | +24 | +12 | pszImageバッファの最大文字数。 |
| xOffsetPercent | INT | 4 | +28 | +16 | 背景画像の水平位置をパーセントで指定する。 |
| yOffsetPercent | INT | 4 | +32 | +20 | 背景画像の垂直位置をパーセントで指定する。 |
各言語での定義
#include <windows.h>
// LVBKIMAGEA (x64 40 / x86 24 バイト)
typedef struct LVBKIMAGEA {
LIST_VIEW_BACKGROUND_IMAGE_FLAGS ulFlags;
HBITMAP hbm;
LPSTR pszImage;
DWORD cchImageMax;
INT xOffsetPercent;
INT yOffsetPercent;
} LVBKIMAGEA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct LVBKIMAGEA
{
public uint ulFlags;
public IntPtr hbm;
public IntPtr pszImage;
public uint cchImageMax;
public int xOffsetPercent;
public int yOffsetPercent;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure LVBKIMAGEA
Public ulFlags As UInteger
Public hbm As IntPtr
Public pszImage As IntPtr
Public cchImageMax As UInteger
Public xOffsetPercent As Integer
Public yOffsetPercent As Integer
End Structureimport ctypes
from ctypes import wintypes
class LVBKIMAGEA(ctypes.Structure):
_fields_ = [
("ulFlags", wintypes.DWORD),
("hbm", ctypes.c_void_p),
("pszImage", ctypes.c_void_p),
("cchImageMax", wintypes.DWORD),
("xOffsetPercent", ctypes.c_int),
("yOffsetPercent", ctypes.c_int),
]#[repr(C)]
pub struct LVBKIMAGEA {
pub ulFlags: u32,
pub hbm: *mut core::ffi::c_void,
pub pszImage: *mut core::ffi::c_void,
pub cchImageMax: u32,
pub xOffsetPercent: i32,
pub yOffsetPercent: i32,
}import "golang.org/x/sys/windows"
type LVBKIMAGEA struct {
ulFlags uint32
hbm uintptr
pszImage uintptr
cchImageMax uint32
xOffsetPercent int32
yOffsetPercent int32
}type
LVBKIMAGEA = record
ulFlags: DWORD;
hbm: Pointer;
pszImage: Pointer;
cchImageMax: DWORD;
xOffsetPercent: Integer;
yOffsetPercent: Integer;
end;const LVBKIMAGEA = extern struct {
ulFlags: u32,
hbm: ?*anyopaque,
pszImage: ?*anyopaque,
cchImageMax: u32,
xOffsetPercent: i32,
yOffsetPercent: i32,
};type
LVBKIMAGEA {.bycopy.} = object
ulFlags: uint32
hbm: pointer
pszImage: pointer
cchImageMax: uint32
xOffsetPercent: int32
yOffsetPercent: int32struct LVBKIMAGEA
{
uint ulFlags;
void* hbm;
void* pszImage;
uint cchImageMax;
int xOffsetPercent;
int yOffsetPercent;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; LVBKIMAGEA サイズ: 24 バイト(x86)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; ulFlags : LIST_VIEW_BACKGROUND_IMAGE_FLAGS (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; hbm : HBITMAP (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; pszImage : LPSTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; cchImageMax : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; xOffsetPercent : INT (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; yOffsetPercent : INT (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; LVBKIMAGEA サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; ulFlags : LIST_VIEW_BACKGROUND_IMAGE_FLAGS (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; hbm : HBITMAP (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; pszImage : LPSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; cchImageMax : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; xOffsetPercent : INT (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; yOffsetPercent : INT (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global LVBKIMAGEA
#field int ulFlags
#field intptr hbm
#field intptr pszImage
#field int cchImageMax
#field int xOffsetPercent
#field int yOffsetPercent
#endstruct
stdim st, LVBKIMAGEA ; NSTRUCT 変数を確保
st->ulFlags = 100
mes "ulFlags=" + st->ulFlags