Win32 API 日本語リファレンス
ホームDevices.Fax › STISUBSCRIBE

STISUBSCRIBE

構造体
サイズx64: 40 バイト / x86: 24 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
dwSizeDWORD4+0+0この構造体のサイズをバイト単位で示すDWORD。
dwFlagsDWORD4+4+4通知方法を指定するフラグを示すDWORD。ウィンドウ/イベント等。
dwFilterDWORD4+8+8受信したい通知の種類を絞るフィルタを示すDWORD。
hWndNotifyHWND8/4+16+12通知メッセージを送るウィンドウのハンドル。
hEventHANDLE8/4+24+16通知時にシグナル状態にするイベントのハンドル。
uiNotificationMessageDWORD4+32+20ウィンドウに送る通知メッセージ番号を示すDWORD。

各言語での定義

#include <windows.h>

// STISUBSCRIBE  (x64 40 / x86 24 バイト)
typedef struct STISUBSCRIBE {
    DWORD dwSize;
    DWORD dwFlags;
    DWORD dwFilter;
    HWND hWndNotify;
    HANDLE hEvent;
    DWORD uiNotificationMessage;
} STISUBSCRIBE;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct STISUBSCRIBE
{
    public uint dwSize;
    public uint dwFlags;
    public uint dwFilter;
    public IntPtr hWndNotify;
    public IntPtr hEvent;
    public uint uiNotificationMessage;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure STISUBSCRIBE
    Public dwSize As UInteger
    Public dwFlags As UInteger
    Public dwFilter As UInteger
    Public hWndNotify As IntPtr
    Public hEvent As IntPtr
    Public uiNotificationMessage As UInteger
End Structure
import ctypes
from ctypes import wintypes

class STISUBSCRIBE(ctypes.Structure):
    _fields_ = [
        ("dwSize", wintypes.DWORD),
        ("dwFlags", wintypes.DWORD),
        ("dwFilter", wintypes.DWORD),
        ("hWndNotify", ctypes.c_void_p),
        ("hEvent", ctypes.c_void_p),
        ("uiNotificationMessage", wintypes.DWORD),
    ]
#[repr(C)]
pub struct STISUBSCRIBE {
    pub dwSize: u32,
    pub dwFlags: u32,
    pub dwFilter: u32,
    pub hWndNotify: *mut core::ffi::c_void,
    pub hEvent: *mut core::ffi::c_void,
    pub uiNotificationMessage: u32,
}
import "golang.org/x/sys/windows"

type STISUBSCRIBE struct {
	dwSize uint32
	dwFlags uint32
	dwFilter uint32
	hWndNotify uintptr
	hEvent uintptr
	uiNotificationMessage uint32
}
type
  STISUBSCRIBE = record
    dwSize: DWORD;
    dwFlags: DWORD;
    dwFilter: DWORD;
    hWndNotify: Pointer;
    hEvent: Pointer;
    uiNotificationMessage: DWORD;
  end;
const STISUBSCRIBE = extern struct {
    dwSize: u32,
    dwFlags: u32,
    dwFilter: u32,
    hWndNotify: ?*anyopaque,
    hEvent: ?*anyopaque,
    uiNotificationMessage: u32,
};
type
  STISUBSCRIBE {.bycopy.} = object
    dwSize: uint32
    dwFlags: uint32
    dwFilter: uint32
    hWndNotify: pointer
    hEvent: pointer
    uiNotificationMessage: uint32
struct STISUBSCRIBE
{
    uint dwSize;
    uint dwFlags;
    uint dwFilter;
    void* hWndNotify;
    void* hEvent;
    uint uiNotificationMessage;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; STISUBSCRIBE サイズ: 24 バイト(x86)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwFilter : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; hWndNotify : HWND (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; hEvent : HANDLE (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; uiNotificationMessage : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; STISUBSCRIBE サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwFilter : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; hWndNotify : HWND (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; hEvent : HANDLE (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; uiNotificationMessage : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global STISUBSCRIBE
    #field int dwSize
    #field int dwFlags
    #field int dwFilter
    #field intptr hWndNotify
    #field intptr hEvent
    #field int uiNotificationMessage
#endstruct

stdim st, STISUBSCRIBE        ; NSTRUCT 変数を確保
st->dwSize = 100
mes "dwSize=" + st->dwSize