Win32 API 日本語リファレンス
ホームSystem.Search › SUBSCRIPTIONITEMINFO

SUBSCRIPTIONITEMINFO

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

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

フィールド

フィールドサイズx64x86説明
cbSizeDWORD4+0+0この構造体のバイト数。呼び出し前に sizeof で設定する。
dwFlagsDWORD4+4+4サブスクリプション項目の動作を制御するフラグのビット集合。
dwPriorityDWORD4+8+8サブスクリプション処理の優先度。値が大きいほど高優先となる。
ScheduleGroupGUID16+12+12同一スケジュールでまとめて処理するグループを識別する GUID。
clsidAgentGUID16+28+28サブスクリプションを処理するエージェント COM オブジェクトの CLSID。

各言語での定義

#include <windows.h>

// SUBSCRIPTIONITEMINFO  (x64 44 / x86 44 バイト)
typedef struct SUBSCRIPTIONITEMINFO {
    DWORD cbSize;
    DWORD dwFlags;
    DWORD dwPriority;
    GUID ScheduleGroup;
    GUID clsidAgent;
} SUBSCRIPTIONITEMINFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SUBSCRIPTIONITEMINFO
{
    public uint cbSize;
    public uint dwFlags;
    public uint dwPriority;
    public Guid ScheduleGroup;
    public Guid clsidAgent;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SUBSCRIPTIONITEMINFO
    Public cbSize As UInteger
    Public dwFlags As UInteger
    Public dwPriority As UInteger
    Public ScheduleGroup As Guid
    Public clsidAgent As Guid
End Structure
import ctypes
from ctypes import wintypes

class SUBSCRIPTIONITEMINFO(ctypes.Structure):
    _fields_ = [
        ("cbSize", wintypes.DWORD),
        ("dwFlags", wintypes.DWORD),
        ("dwPriority", wintypes.DWORD),
        ("ScheduleGroup", GUID),
        ("clsidAgent", GUID),
    ]
#[repr(C)]
pub struct SUBSCRIPTIONITEMINFO {
    pub cbSize: u32,
    pub dwFlags: u32,
    pub dwPriority: u32,
    pub ScheduleGroup: GUID,
    pub clsidAgent: GUID,
}
import "golang.org/x/sys/windows"

type SUBSCRIPTIONITEMINFO struct {
	cbSize uint32
	dwFlags uint32
	dwPriority uint32
	ScheduleGroup windows.GUID
	clsidAgent windows.GUID
}
type
  SUBSCRIPTIONITEMINFO = record
    cbSize: DWORD;
    dwFlags: DWORD;
    dwPriority: DWORD;
    ScheduleGroup: TGUID;
    clsidAgent: TGUID;
  end;
const SUBSCRIPTIONITEMINFO = extern struct {
    cbSize: u32,
    dwFlags: u32,
    dwPriority: u32,
    ScheduleGroup: GUID,
    clsidAgent: GUID,
};
type
  SUBSCRIPTIONITEMINFO {.bycopy.} = object
    cbSize: uint32
    dwFlags: uint32
    dwPriority: uint32
    ScheduleGroup: GUID
    clsidAgent: GUID
struct SUBSCRIPTIONITEMINFO
{
    uint cbSize;
    uint dwFlags;
    uint dwPriority;
    GUID ScheduleGroup;
    GUID clsidAgent;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SUBSCRIPTIONITEMINFO サイズ: 44 バイト(x64)
dim st, 11    ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwPriority : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; ScheduleGroup : GUID (+12, 16byte)  varptr(st)+12 を基点に操作(16byte:入れ子/配列)
; clsidAgent : GUID (+28, 16byte)  varptr(st)+28 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
    #field int Data1
    #field short Data2
    #field short Data3
    #field byte Data4 8
#endstruct

#defstruct global SUBSCRIPTIONITEMINFO
    #field int cbSize
    #field int dwFlags
    #field int dwPriority
    #field GUID ScheduleGroup
    #field GUID clsidAgent
#endstruct

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