Win32 API 日本語リファレンス
ホームUI.Controls › TASKDIALOGCONFIG

TASKDIALOGCONFIG

構造体
サイズx64: 160 バイト / x86: 96 バイトパッキング1

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

フィールド

フィールドサイズx64x86説明
cbSizeDWORD4+0+0この構造体のバイトサイズ。呼び出し前に設定する。
hwndParentHWND8/4+4+4タスクダイアログの親ウィンドウのハンドル。NULL可。
hInstanceHINSTANCE8/4+12+8アイコンや文字列リソースを含むモジュールのインスタンスハンドル。
dwFlagsTASKDIALOG_FLAGS4+20+12ダイアログの動作を指定するフラグ(TASKDIALOG_FLAGS、TDF_*)。
dwCommonButtonsTASKDIALOG_COMMON_BUTTON_FLAGS4+24+16表示する共通ボタン(TASKDIALOG_COMMON_BUTTON_FLAGS、TDCBF_*)。
pszWindowTitleLPWSTR8/4+28+20ダイアログのタイトルバー文字列(Unicode)。
Anonymous1_Anonymous1_e__Union8/4+36+24メインアイコンを指定する共用体(リソースIDまたはHICON)。
pszMainInstructionLPWSTR8/4+44+28強調表示される主指示文字列(Unicode)。
pszContentLPWSTR8/4+52+32本文の説明テキスト(Unicode)。
cButtonsDWORD4+60+36pButtons配列のカスタムボタン数。
pButtonsTASKDIALOG_BUTTON*8/4+64+40カスタムボタン定義の配列へのポインター(TASKDIALOG_BUTTON)。
nDefaultButtonINT4+72+44既定ボタンの識別子。
cRadioButtonsDWORD4+76+48pRadioButtons配列のラジオボタン数。
pRadioButtonsTASKDIALOG_BUTTON*8/4+80+52ラジオボタン定義の配列へのポインター(TASKDIALOG_BUTTON)。
nDefaultRadioButtonINT4+88+56既定で選択されるラジオボタンの識別子。
pszVerificationTextLPWSTR8/4+92+60検証チェックボックスのラベル文字列(Unicode)。
pszExpandedInformationLPWSTR8/4+100+64展開時に表示する追加情報文字列(Unicode)。
pszExpandedControlTextLPWSTR8/4+108+68展開トグルに表示するテキスト(Unicode)。
pszCollapsedControlTextLPWSTR8/4+116+72折りたたみトグルに表示するテキスト(Unicode)。
Anonymous2_Anonymous2_e__Union8/4+124+76フッターアイコンを指定する共用体(リソースIDまたはHICON)。
pszFooterLPWSTR8/4+132+80フッターに表示するテキスト(Unicode)。
pfCallbackPFTASKDIALOGCALLBACK8/4+140+84ダイアログイベントを処理するコールバック関数(PFTASKDIALOGCALLBACK)。
lpCallbackDataINT_PTR8/4+148+88コールバックに渡すアプリケーション定義値。
cxWidthDWORD4+156+92ダイアログのクライアント幅(DLU単位)。0で自動。

共用体: _Anonymous1_e__Union x64 8B / x86 4B

フィールドサイズx64x86
hMainIconHICON8/4+0+0
pszMainIconLPWSTR8/4+0+0

共用体: _Anonymous2_e__Union x64 8B / x86 4B

フィールドサイズx64x86
hFooterIconHICON8/4+0+0
pszFooterIconLPWSTR8/4+0+0

各言語での定義

#include <windows.h>

// TASKDIALOGCONFIG  (x64 160 / x86 96 バイト)
#pragma pack(push, 1)
typedef struct TASKDIALOGCONFIG {
    DWORD cbSize;
    HWND hwndParent;
    HINSTANCE hInstance;
    TASKDIALOG_FLAGS dwFlags;
    TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons;
    LPWSTR pszWindowTitle;
    _Anonymous1_e__Union Anonymous1;
    LPWSTR pszMainInstruction;
    LPWSTR pszContent;
    DWORD cButtons;
    TASKDIALOG_BUTTON* pButtons;
    INT nDefaultButton;
    DWORD cRadioButtons;
    TASKDIALOG_BUTTON* pRadioButtons;
    INT nDefaultRadioButton;
    LPWSTR pszVerificationText;
    LPWSTR pszExpandedInformation;
    LPWSTR pszExpandedControlText;
    LPWSTR pszCollapsedControlText;
    _Anonymous2_e__Union Anonymous2;
    LPWSTR pszFooter;
    PFTASKDIALOGCALLBACK pfCallback;
    INT_PTR lpCallbackData;
    DWORD cxWidth;
} TASKDIALOGCONFIG;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct TASKDIALOGCONFIG
{
    public uint cbSize;
    public IntPtr hwndParent;
    public IntPtr hInstance;
    public int dwFlags;
    public int dwCommonButtons;
    public IntPtr pszWindowTitle;
    public _Anonymous1_e__Union Anonymous1;
    public IntPtr pszMainInstruction;
    public IntPtr pszContent;
    public uint cButtons;
    public IntPtr pButtons;
    public int nDefaultButton;
    public uint cRadioButtons;
    public IntPtr pRadioButtons;
    public int nDefaultRadioButton;
    public IntPtr pszVerificationText;
    public IntPtr pszExpandedInformation;
    public IntPtr pszExpandedControlText;
    public IntPtr pszCollapsedControlText;
    public _Anonymous2_e__Union Anonymous2;
    public IntPtr pszFooter;
    public IntPtr pfCallback;
    public IntPtr lpCallbackData;
    public uint cxWidth;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure TASKDIALOGCONFIG
    Public cbSize As UInteger
    Public hwndParent As IntPtr
    Public hInstance As IntPtr
    Public dwFlags As Integer
    Public dwCommonButtons As Integer
    Public pszWindowTitle As IntPtr
    Public Anonymous1 As _Anonymous1_e__Union
    Public pszMainInstruction As IntPtr
    Public pszContent As IntPtr
    Public cButtons As UInteger
    Public pButtons As IntPtr
    Public nDefaultButton As Integer
    Public cRadioButtons As UInteger
    Public pRadioButtons As IntPtr
    Public nDefaultRadioButton As Integer
    Public pszVerificationText As IntPtr
    Public pszExpandedInformation As IntPtr
    Public pszExpandedControlText As IntPtr
    Public pszCollapsedControlText As IntPtr
    Public Anonymous2 As _Anonymous2_e__Union
    Public pszFooter As IntPtr
    Public pfCallback As IntPtr
    Public lpCallbackData As IntPtr
    Public cxWidth As UInteger
End Structure
import ctypes
from ctypes import wintypes

class TASKDIALOGCONFIG(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("cbSize", wintypes.DWORD),
        ("hwndParent", ctypes.c_void_p),
        ("hInstance", ctypes.c_void_p),
        ("dwFlags", ctypes.c_int),
        ("dwCommonButtons", ctypes.c_int),
        ("pszWindowTitle", ctypes.c_void_p),
        ("Anonymous1", _Anonymous1_e__Union),
        ("pszMainInstruction", ctypes.c_void_p),
        ("pszContent", ctypes.c_void_p),
        ("cButtons", wintypes.DWORD),
        ("pButtons", ctypes.c_void_p),
        ("nDefaultButton", ctypes.c_int),
        ("cRadioButtons", wintypes.DWORD),
        ("pRadioButtons", ctypes.c_void_p),
        ("nDefaultRadioButton", ctypes.c_int),
        ("pszVerificationText", ctypes.c_void_p),
        ("pszExpandedInformation", ctypes.c_void_p),
        ("pszExpandedControlText", ctypes.c_void_p),
        ("pszCollapsedControlText", ctypes.c_void_p),
        ("Anonymous2", _Anonymous2_e__Union),
        ("pszFooter", ctypes.c_void_p),
        ("pfCallback", ctypes.c_void_p),
        ("lpCallbackData", ctypes.c_ssize_t),
        ("cxWidth", wintypes.DWORD),
    ]
#[repr(C, packed(1))]
pub struct TASKDIALOGCONFIG {
    pub cbSize: u32,
    pub hwndParent: *mut core::ffi::c_void,
    pub hInstance: *mut core::ffi::c_void,
    pub dwFlags: i32,
    pub dwCommonButtons: i32,
    pub pszWindowTitle: *mut core::ffi::c_void,
    pub Anonymous1: _Anonymous1_e__Union,
    pub pszMainInstruction: *mut core::ffi::c_void,
    pub pszContent: *mut core::ffi::c_void,
    pub cButtons: u32,
    pub pButtons: *mut core::ffi::c_void,
    pub nDefaultButton: i32,
    pub cRadioButtons: u32,
    pub pRadioButtons: *mut core::ffi::c_void,
    pub nDefaultRadioButton: i32,
    pub pszVerificationText: *mut core::ffi::c_void,
    pub pszExpandedInformation: *mut core::ffi::c_void,
    pub pszExpandedControlText: *mut core::ffi::c_void,
    pub pszCollapsedControlText: *mut core::ffi::c_void,
    pub Anonymous2: _Anonymous2_e__Union,
    pub pszFooter: *mut core::ffi::c_void,
    pub pfCallback: *mut core::ffi::c_void,
    pub lpCallbackData: isize,
    pub cxWidth: u32,
}
import "golang.org/x/sys/windows"

type TASKDIALOGCONFIG struct {
	cbSize uint32
	hwndParent uintptr
	hInstance uintptr
	dwFlags int32
	dwCommonButtons int32
	pszWindowTitle uintptr
	Anonymous1 _Anonymous1_e__Union
	pszMainInstruction uintptr
	pszContent uintptr
	cButtons uint32
	pButtons uintptr
	nDefaultButton int32
	cRadioButtons uint32
	pRadioButtons uintptr
	nDefaultRadioButton int32
	pszVerificationText uintptr
	pszExpandedInformation uintptr
	pszExpandedControlText uintptr
	pszCollapsedControlText uintptr
	Anonymous2 _Anonymous2_e__Union
	pszFooter uintptr
	pfCallback uintptr
	lpCallbackData uintptr
	cxWidth uint32
}
type
  TASKDIALOGCONFIG = packed record
    cbSize: DWORD;
    hwndParent: Pointer;
    hInstance: Pointer;
    dwFlags: Integer;
    dwCommonButtons: Integer;
    pszWindowTitle: Pointer;
    Anonymous1: _Anonymous1_e__Union;
    pszMainInstruction: Pointer;
    pszContent: Pointer;
    cButtons: DWORD;
    pButtons: Pointer;
    nDefaultButton: Integer;
    cRadioButtons: DWORD;
    pRadioButtons: Pointer;
    nDefaultRadioButton: Integer;
    pszVerificationText: Pointer;
    pszExpandedInformation: Pointer;
    pszExpandedControlText: Pointer;
    pszCollapsedControlText: Pointer;
    Anonymous2: _Anonymous2_e__Union;
    pszFooter: Pointer;
    pfCallback: Pointer;
    lpCallbackData: NativeInt;
    cxWidth: DWORD;
  end;
const TASKDIALOGCONFIG = extern struct {
    cbSize: u32,
    hwndParent: ?*anyopaque,
    hInstance: ?*anyopaque,
    dwFlags: i32,
    dwCommonButtons: i32,
    pszWindowTitle: ?*anyopaque,
    Anonymous1: _Anonymous1_e__Union,
    pszMainInstruction: ?*anyopaque,
    pszContent: ?*anyopaque,
    cButtons: u32,
    pButtons: ?*anyopaque,
    nDefaultButton: i32,
    cRadioButtons: u32,
    pRadioButtons: ?*anyopaque,
    nDefaultRadioButton: i32,
    pszVerificationText: ?*anyopaque,
    pszExpandedInformation: ?*anyopaque,
    pszExpandedControlText: ?*anyopaque,
    pszCollapsedControlText: ?*anyopaque,
    Anonymous2: _Anonymous2_e__Union,
    pszFooter: ?*anyopaque,
    pfCallback: ?*anyopaque,
    lpCallbackData: isize,
    cxWidth: u32,
};
type
  TASKDIALOGCONFIG {.packed.} = object
    cbSize: uint32
    hwndParent: pointer
    hInstance: pointer
    dwFlags: int32
    dwCommonButtons: int32
    pszWindowTitle: pointer
    Anonymous1: _Anonymous1_e__Union
    pszMainInstruction: pointer
    pszContent: pointer
    cButtons: uint32
    pButtons: pointer
    nDefaultButton: int32
    cRadioButtons: uint32
    pRadioButtons: pointer
    nDefaultRadioButton: int32
    pszVerificationText: pointer
    pszExpandedInformation: pointer
    pszExpandedControlText: pointer
    pszCollapsedControlText: pointer
    Anonymous2: _Anonymous2_e__Union
    pszFooter: pointer
    pfCallback: pointer
    lpCallbackData: int
    cxWidth: uint32
align(1)
struct TASKDIALOGCONFIG
{
    uint cbSize;
    void* hwndParent;
    void* hInstance;
    int dwFlags;
    int dwCommonButtons;
    void* pszWindowTitle;
    _Anonymous1_e__Union Anonymous1;
    void* pszMainInstruction;
    void* pszContent;
    uint cButtons;
    void* pButtons;
    int nDefaultButton;
    uint cRadioButtons;
    void* pRadioButtons;
    int nDefaultRadioButton;
    void* pszVerificationText;
    void* pszExpandedInformation;
    void* pszExpandedControlText;
    void* pszCollapsedControlText;
    _Anonymous2_e__Union Anonymous2;
    void* pszFooter;
    void* pfCallback;
    ptrdiff_t lpCallbackData;
    uint cxWidth;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; TASKDIALOGCONFIG サイズ: 96 バイト(x86)
dim st, 24    ; 4byte整数×24(構造体サイズ 96 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; hwndParent : HWND (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; hInstance : HINSTANCE (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwFlags : TASKDIALOG_FLAGS (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; dwCommonButtons : TASKDIALOG_COMMON_BUTTON_FLAGS (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; pszWindowTitle : LPWSTR (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; Anonymous1 : _Anonymous1_e__Union (+24, 4byte)  varptr(st)+24 を基点に操作(4byte:入れ子/配列)
; pszMainInstruction : LPWSTR (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; pszContent : LPWSTR (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; cButtons : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; pButtons : TASKDIALOG_BUTTON* (+40, 4byte)  varptr(st)+40 を基点に操作(4byte:入れ子/配列)
; nDefaultButton : INT (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; cRadioButtons : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; pRadioButtons : TASKDIALOG_BUTTON* (+52, 4byte)  varptr(st)+52 を基点に操作(4byte:入れ子/配列)
; nDefaultRadioButton : INT (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; pszVerificationText : LPWSTR (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; pszExpandedInformation : LPWSTR (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; pszExpandedControlText : LPWSTR (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; pszCollapsedControlText : LPWSTR (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; Anonymous2 : _Anonymous2_e__Union (+76, 4byte)  varptr(st)+76 を基点に操作(4byte:入れ子/配列)
; pszFooter : LPWSTR (+80, 4byte)  st.20 = 値  /  値 = st.20   (lpoke/lpeek も可)
; pfCallback : PFTASKDIALOGCALLBACK (+84, 4byte)  st.21 = 値  /  値 = st.21   (lpoke/lpeek も可)
; lpCallbackData : INT_PTR (+88, 4byte)  st.22 = 値  /  値 = st.22   (lpoke/lpeek も可)
; cxWidth : DWORD (+92, 4byte)  st.23 = 値  /  値 = st.23   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; TASKDIALOGCONFIG サイズ: 160 バイト(x64)
dim st, 40    ; 4byte整数×40(構造体サイズ 160 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; hwndParent : HWND (+4, 8byte)  qpoke st,4,値 / qpeek(st,4)  ※IronHSPのみ。3.7/3.8は lpoke st,4,下位 : lpoke st,8,上位
; hInstance : HINSTANCE (+12, 8byte)  qpoke st,12,値 / qpeek(st,12)  ※IronHSPのみ。3.7/3.8は lpoke st,12,下位 : lpoke st,16,上位
; dwFlags : TASKDIALOG_FLAGS (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; dwCommonButtons : TASKDIALOG_COMMON_BUTTON_FLAGS (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; pszWindowTitle : LPWSTR (+28, 8byte)  qpoke st,28,値 / qpeek(st,28)  ※IronHSPのみ。3.7/3.8は lpoke st,28,下位 : lpoke st,32,上位
; Anonymous1 : _Anonymous1_e__Union (+36, 8byte)  varptr(st)+36 を基点に操作(8byte:入れ子/配列)
; pszMainInstruction : LPWSTR (+44, 8byte)  qpoke st,44,値 / qpeek(st,44)  ※IronHSPのみ。3.7/3.8は lpoke st,44,下位 : lpoke st,48,上位
; pszContent : LPWSTR (+52, 8byte)  qpoke st,52,値 / qpeek(st,52)  ※IronHSPのみ。3.7/3.8は lpoke st,52,下位 : lpoke st,56,上位
; cButtons : DWORD (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; pButtons : TASKDIALOG_BUTTON* (+64, 8byte)  varptr(st)+64 を基点に操作(8byte:入れ子/配列)
; nDefaultButton : INT (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; cRadioButtons : DWORD (+76, 4byte)  st.19 = 値  /  値 = st.19   (lpoke/lpeek も可)
; pRadioButtons : TASKDIALOG_BUTTON* (+80, 8byte)  varptr(st)+80 を基点に操作(8byte:入れ子/配列)
; nDefaultRadioButton : INT (+88, 4byte)  st.22 = 値  /  値 = st.22   (lpoke/lpeek も可)
; pszVerificationText : LPWSTR (+92, 8byte)  qpoke st,92,値 / qpeek(st,92)  ※IronHSPのみ。3.7/3.8は lpoke st,92,下位 : lpoke st,96,上位
; pszExpandedInformation : LPWSTR (+100, 8byte)  qpoke st,100,値 / qpeek(st,100)  ※IronHSPのみ。3.7/3.8は lpoke st,100,下位 : lpoke st,104,上位
; pszExpandedControlText : LPWSTR (+108, 8byte)  qpoke st,108,値 / qpeek(st,108)  ※IronHSPのみ。3.7/3.8は lpoke st,108,下位 : lpoke st,112,上位
; pszCollapsedControlText : LPWSTR (+116, 8byte)  qpoke st,116,値 / qpeek(st,116)  ※IronHSPのみ。3.7/3.8は lpoke st,116,下位 : lpoke st,120,上位
; Anonymous2 : _Anonymous2_e__Union (+124, 8byte)  varptr(st)+124 を基点に操作(8byte:入れ子/配列)
; pszFooter : LPWSTR (+132, 8byte)  qpoke st,132,値 / qpeek(st,132)  ※IronHSPのみ。3.7/3.8は lpoke st,132,下位 : lpoke st,136,上位
; pfCallback : PFTASKDIALOGCALLBACK (+140, 8byte)  qpoke st,140,値 / qpeek(st,140)  ※IronHSPのみ。3.7/3.8は lpoke st,140,下位 : lpoke st,144,上位
; lpCallbackData : INT_PTR (+148, 8byte)  qpoke st,148,値 / qpeek(st,148)  ※IronHSPのみ。3.7/3.8は lpoke st,148,下位 : lpoke st,152,上位
; cxWidth : DWORD (+156, 4byte)  st.39 = 値  /  値 = st.39   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global TASKDIALOGCONFIG, pack=1
    #field int cbSize
    #field intptr hwndParent
    #field intptr hInstance
    #field int dwFlags
    #field int dwCommonButtons
    #field intptr pszWindowTitle
    #field byte Anonymous1 8
    #field intptr pszMainInstruction
    #field intptr pszContent
    #field int cButtons
    #field intptr pButtons
    #field int nDefaultButton
    #field int cRadioButtons
    #field intptr pRadioButtons
    #field int nDefaultRadioButton
    #field intptr pszVerificationText
    #field intptr pszExpandedInformation
    #field intptr pszExpandedControlText
    #field intptr pszCollapsedControlText
    #field byte Anonymous2 8
    #field intptr pszFooter
    #field intptr pfCallback
    #field intptr lpCallbackData
    #field int cxWidth
#endstruct

stdim st, TASKDIALOGCONFIG        ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。