SHChangeUpdateImageIDList
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cb | WORD | 2 | +0 | +0 | この構造体の有効サイズをバイト単位で表す。 |
| iIconIndex | INT | 4 | +2 | +2 | システムイメージリスト内の更新対象アイコンのインデックス。 |
| iCurIndex | INT | 4 | +6 | +6 | 現在のシステムイメージリスト内のインデックスを示す。 |
| uFlags | DWORD | 4 | +10 | +10 | アイコン更新の挙動を制御するフラグ群。 |
| dwProcessID | DWORD | 4 | +14 | +14 | イメージ更新を要求したプロセスのID。 |
| szName | WCHAR | 520 | +18 | +18 | 関連ファイルやリソースのパスを格納する WCHAR 配列。 |
| cbZero | WORD | 2 | +538 | +538 | PIDL の終端を示すゼロ終端マーカー。常に0となる。 |
各言語での定義
#include <windows.h>
// SHChangeUpdateImageIDList (x64 540 / x86 540 バイト)
#pragma pack(push, 1)
typedef struct SHChangeUpdateImageIDList {
WORD cb;
INT iIconIndex;
INT iCurIndex;
DWORD uFlags;
DWORD dwProcessID;
WCHAR szName[260];
WORD cbZero;
} SHChangeUpdateImageIDList;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct SHChangeUpdateImageIDList
{
public ushort cb;
public int iIconIndex;
public int iCurIndex;
public uint uFlags;
public uint dwProcessID;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] public string szName;
public ushort cbZero;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure SHChangeUpdateImageIDList
Public cb As UShort
Public iIconIndex As Integer
Public iCurIndex As Integer
Public uFlags As UInteger
Public dwProcessID As UInteger
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=260)> Public szName As String
Public cbZero As UShort
End Structureimport ctypes
from ctypes import wintypes
class SHChangeUpdateImageIDList(ctypes.Structure):
_pack_ = 1
_fields_ = [
("cb", ctypes.c_ushort),
("iIconIndex", ctypes.c_int),
("iCurIndex", ctypes.c_int),
("uFlags", wintypes.DWORD),
("dwProcessID", wintypes.DWORD),
("szName", ctypes.c_wchar * 260),
("cbZero", ctypes.c_ushort),
]#[repr(C, packed(1))]
pub struct SHChangeUpdateImageIDList {
pub cb: u16,
pub iIconIndex: i32,
pub iCurIndex: i32,
pub uFlags: u32,
pub dwProcessID: u32,
pub szName: [u16; 260],
pub cbZero: u16,
}import "golang.org/x/sys/windows"
type SHChangeUpdateImageIDList struct {
cb uint16
iIconIndex int32
iCurIndex int32
uFlags uint32
dwProcessID uint32
szName [260]uint16
cbZero uint16
}type
SHChangeUpdateImageIDList = packed record
cb: Word;
iIconIndex: Integer;
iCurIndex: Integer;
uFlags: DWORD;
dwProcessID: DWORD;
szName: array[0..259] of WideChar;
cbZero: Word;
end;const SHChangeUpdateImageIDList = extern struct {
cb: u16,
iIconIndex: i32,
iCurIndex: i32,
uFlags: u32,
dwProcessID: u32,
szName: [260]u16,
cbZero: u16,
};type
SHChangeUpdateImageIDList {.packed.} = object
cb: uint16
iIconIndex: int32
iCurIndex: int32
uFlags: uint32
dwProcessID: uint32
szName: array[260, uint16]
cbZero: uint16align(1)
struct SHChangeUpdateImageIDList
{
ushort cb;
int iIconIndex;
int iCurIndex;
uint uFlags;
uint dwProcessID;
wchar[260] szName;
ushort cbZero;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SHChangeUpdateImageIDList サイズ: 540 バイト(x64)
dim st, 135 ; 4byte整数×135(構造体サイズ 540 / 4 切り上げ)
; cb : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; iIconIndex : INT (+2, 4byte) lpoke st,2,値 / 値 = lpeek(st,2)
; iCurIndex : INT (+6, 4byte) lpoke st,6,値 / 値 = lpeek(st,6)
; uFlags : DWORD (+10, 4byte) lpoke st,10,値 / 値 = lpeek(st,10)
; dwProcessID : DWORD (+14, 4byte) lpoke st,14,値 / 値 = lpeek(st,14)
; szName : WCHAR (+18, 520byte) varptr(st)+18 を基点に操作(520byte:入れ子/配列)
; cbZero : WORD (+538, 2byte) wpoke st,538,値 / 値 = wpeek(st,538)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SHChangeUpdateImageIDList, pack=1
#field short cb
#field int iIconIndex
#field int iCurIndex
#field int uFlags
#field int dwProcessID
#field wchar szName 260
#field short cbZero
#endstruct
stdim st, SHChangeUpdateImageIDList ; NSTRUCT 変数を確保
st->cb = 100
mes "cb=" + st->cb