SMCSHCHANGENOTIFYSTRUCT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| lEvent | INT | 4 | +0 | +0 | 発生したシェル変更イベントの種類(SHCNE_定数)。 |
| pidl1 | ITEMIDLIST* | 8/4 | +8 | +4 | イベントに関わる第1のアイテムIDリスト(PIDL)。 |
| pidl2 | ITEMIDLIST* | 8/4 | +16 | +8 | イベントに関わる第2のアイテムIDリスト(PIDL)。NULL可。 |
各言語での定義
#include <windows.h>
// SMCSHCHANGENOTIFYSTRUCT (x64 24 / x86 12 バイト)
typedef struct SMCSHCHANGENOTIFYSTRUCT {
INT lEvent;
ITEMIDLIST* pidl1;
ITEMIDLIST* pidl2;
} SMCSHCHANGENOTIFYSTRUCT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SMCSHCHANGENOTIFYSTRUCT
{
public int lEvent;
public IntPtr pidl1;
public IntPtr pidl2;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SMCSHCHANGENOTIFYSTRUCT
Public lEvent As Integer
Public pidl1 As IntPtr
Public pidl2 As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class SMCSHCHANGENOTIFYSTRUCT(ctypes.Structure):
_fields_ = [
("lEvent", ctypes.c_int),
("pidl1", ctypes.c_void_p),
("pidl2", ctypes.c_void_p),
]#[repr(C)]
pub struct SMCSHCHANGENOTIFYSTRUCT {
pub lEvent: i32,
pub pidl1: *mut core::ffi::c_void,
pub pidl2: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type SMCSHCHANGENOTIFYSTRUCT struct {
lEvent int32
pidl1 uintptr
pidl2 uintptr
}type
SMCSHCHANGENOTIFYSTRUCT = record
lEvent: Integer;
pidl1: Pointer;
pidl2: Pointer;
end;const SMCSHCHANGENOTIFYSTRUCT = extern struct {
lEvent: i32,
pidl1: ?*anyopaque,
pidl2: ?*anyopaque,
};type
SMCSHCHANGENOTIFYSTRUCT {.bycopy.} = object
lEvent: int32
pidl1: pointer
pidl2: pointerstruct SMCSHCHANGENOTIFYSTRUCT
{
int lEvent;
void* pidl1;
void* pidl2;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; SMCSHCHANGENOTIFYSTRUCT サイズ: 12 バイト(x86)
dim st, 3 ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; lEvent : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pidl1 : ITEMIDLIST* (+4, 4byte) varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; pidl2 : ITEMIDLIST* (+8, 4byte) varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SMCSHCHANGENOTIFYSTRUCT サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; lEvent : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pidl1 : ITEMIDLIST* (+8, 8byte) varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; pidl2 : ITEMIDLIST* (+16, 8byte) varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SMCSHCHANGENOTIFYSTRUCT
#field int lEvent
#field intptr pidl1
#field intptr pidl2
#endstruct
stdim st, SMCSHCHANGENOTIFYSTRUCT ; NSTRUCT 変数を確保
st->lEvent = 100
mes "lEvent=" + st->lEvent