public TASKDIALOGCONFIG(bool construct) { this.cbSize = (uint)Marshal.SizeOf(typeof(TASKDIALOGCONFIG)); this.hwndParent = System.IntPtr.Zero; this.hInstance = System.IntPtr.Zero; this.dwFlags = TASKDIALOG_FLAGS.NONE; //if(Program.Translation.Properties.RightToLeft) dwFlags |= VtdFlags.RtlLayout; this.dwCommonButtons = TASKDIALOG_COMMON_BUTTON_FLAGS.TDCBF_NONE_BUTTON; this.pszWindowTitle = null; this.MainIcon = new TASKDIALOGCONFIG_ICON_UNION( ); this.pszMainInstruction = string.Empty; this.pszContent = string.Empty; this.cButtons = 0; this.pButtons = System.IntPtr.Zero; this.nDefaultButton = 0; this.cRadioButtons = 0; this.pRadioButtons = System.IntPtr.Zero; this.nDefaultRadioButton = 0; this.pszVerificationText = null; this.pszExpandedInformation = null; this.pszExpandedControlText = null; this.pszCollapsedControlText = null; this.FooterIcon = new TASKDIALOGCONFIG_ICON_UNION( ); this.pszFooter = null; this.pfCallback = null; this.lpCallbackData = System.IntPtr.Zero; this.cxWidth = 0; }
public static extern HRESULT TaskDialog(HandleRef hwndParent, SafeLibraryHandle hInstance, string pszWindowTitle, string pszMainInstruction, string pszContent, TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons, IntPtr pszIcon, out int pnButton);
public static extern HRESULT TaskDialog(HWND hwndParent, HINSTANCE hInstance, string pszWindowTitle, string pszMainInstruction, string pszContent, TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons, SafeResourceId pszIcon, out int pnButton);
public static System.Windows.Forms.DialogResult Show(string Content, string Title, System.Windows.Forms.MessageBoxButtons Buttons, System.Windows.Forms.MessageBoxIcon Icon, TASKDIALOG_COMMON_BUTTON_FLAGS CommonButtons, System.IntPtr MainIcon, System.Windows.Forms.IWin32Window Window = null) { TASKDIALOGCONFIG TaskConfig = new TASKDIALOGCONFIG(); TaskConfig.cbSize = (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(TASKDIALOGCONFIG)); TaskConfig.hwndParent = (Window != null) ? Window.Handle : System.IntPtr.Zero; TaskConfig.hInstance = System.IntPtr.Zero; TaskConfig.dwFlags = TASKDIALOG_FLAGS.TDF_SIZE_TO_CONTENT; TaskConfig.dwCommonButtons = CommonButtons; TaskConfig.pszWindowTitle = Title; TaskConfig.hMainIcon = MainIcon; TaskConfig.pszMainInstruction = null; TaskConfig.pszContent = Content; TaskConfig.cButtons = 0; TaskConfig.nDefaultButton = 0; TaskConfig.cRadioButtons = 0; TaskConfig.pszVerificationText = null; TaskConfig.pszExpandedInformation = null; TaskConfig.pszExpandedControlText = null; TaskConfig.pszCollapsedControlText = null; TaskConfig.hFooterIcon = System.IntPtr.Zero; TaskConfig.pszFooter = null; TaskConfig.pfCallback = null; TaskConfig.cxWidth = 0; int iButton; int hr; if (TaskDialogIndirect(ref TaskConfig, out iButton, System.IntPtr.Zero, System.IntPtr.Zero, out hr)) { if (hr == 0) { return((System.Windows.Forms.DialogResult)iButton); } else { System.Diagnostics.Trace.Assert(false); } } return(System.Windows.Forms.MessageBox.Show(Window, Content, Title, Buttons, Icon)); }