ホーム › System.AddressBook › NOTIFICATION
NOTIFICATION
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ulEventType | DWORD | 4 | +0 | +0 | 通知イベントの種類を示すフラグ(fnevObjectCreated等)。 |
| ulAlignPad | DWORD | 4 | +4 | +4 | アラインメント用のパディング。 |
| info | _info_e__Union | 80/56 | +8 | +8 | イベント種別に応じた個別通知構造体を格納する無名共用体。 |
共用体: _info_e__Union x64 80B / x86 56B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| err | ERROR_NOTIFICATION | 32/20 | +0 | +0 |
| newmail | NEWMAIL_NOTIFICATION | 56/28 | +0 | +0 |
| obj | OBJECT_NOTIFICATION | 72/40 | +0 | +0 |
| tab | TABLE_NOTIFICATION | 80/56 | +0 | +0 |
| ext | EXTENDED_NOTIFICATION | 16/12 | +0 | +0 |
| statobj | STATUS_OBJECT_NOTIFICATION | 32/16 | +0 | +0 |
各言語での定義
#include <windows.h>
// NOTIFICATION (x64 88 / x86 64 バイト)
typedef struct NOTIFICATION {
DWORD ulEventType;
DWORD ulAlignPad;
_info_e__Union info;
} NOTIFICATION;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NOTIFICATION
{
public uint ulEventType;
public uint ulAlignPad;
public _info_e__Union info;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NOTIFICATION
Public ulEventType As UInteger
Public ulAlignPad As UInteger
Public info As _info_e__Union
End Structureimport ctypes
from ctypes import wintypes
class NOTIFICATION(ctypes.Structure):
_fields_ = [
("ulEventType", wintypes.DWORD),
("ulAlignPad", wintypes.DWORD),
("info", _info_e__Union),
]#[repr(C)]
pub struct NOTIFICATION {
pub ulEventType: u32,
pub ulAlignPad: u32,
pub info: _info_e__Union,
}import "golang.org/x/sys/windows"
type NOTIFICATION struct {
ulEventType uint32
ulAlignPad uint32
info _info_e__Union
}type
NOTIFICATION = record
ulEventType: DWORD;
ulAlignPad: DWORD;
info: _info_e__Union;
end;const NOTIFICATION = extern struct {
ulEventType: u32,
ulAlignPad: u32,
info: _info_e__Union,
};type
NOTIFICATION {.bycopy.} = object
ulEventType: uint32
ulAlignPad: uint32
info: _info_e__Unionstruct NOTIFICATION
{
uint ulEventType;
uint ulAlignPad;
_info_e__Union info;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; NOTIFICATION サイズ: 64 バイト(x86)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; ulEventType : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; ulAlignPad : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; info : _info_e__Union (+8, 56byte) varptr(st)+8 を基点に操作(56byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; NOTIFICATION サイズ: 88 バイト(x64)
dim st, 22 ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; ulEventType : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; ulAlignPad : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; info : _info_e__Union (+8, 80byte) varptr(st)+8 を基点に操作(80byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global NOTIFICATION
#field int ulEventType
#field int ulAlignPad
#field byte info 80
#endstruct
stdim st, NOTIFICATION ; NSTRUCT 変数を確保
st->ulEventType = 100
mes "ulEventType=" + st->ulEventType
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。