internal NativeTaskDialogSettings()
        {
            nativeConfiguration = new SafeNativeMethods.TASKDIALOGCONFIG();

            // Apply standard settings.
            nativeConfiguration.cbSize = (uint)Marshal.SizeOf(nativeConfiguration);
            nativeConfiguration.hwndParent = SafeNativeMethods.NO_PARENT;
            nativeConfiguration.hInstance = IntPtr.Zero;
            nativeConfiguration.dwFlags = SafeNativeMethods.TASKDIALOG_FLAGS.TDF_ALLOW_DIALOG_CANCELLATION;
            nativeConfiguration.dwCommonButtons = SafeNativeMethods.TASKDIALOG_COMMON_BUTTON_FLAGS.TDCBF_OK_BUTTON;
            nativeConfiguration.MainIcon = new SafeNativeMethods.TASKDIALOGCONFIG_ICON_UNION(0);
            nativeConfiguration.FooterIcon = new SafeNativeMethods.TASKDIALOGCONFIG_ICON_UNION(0);
            nativeConfiguration.cxWidth = TaskDialogDefaults.IdealWidth;

            // Zero out all the custom button fields.
            nativeConfiguration.cButtons = 0;
            nativeConfiguration.cRadioButtons = 0;
            nativeConfiguration.pButtons = IntPtr.Zero;
            nativeConfiguration.pRadioButtons = IntPtr.Zero;
            nativeConfiguration.nDefaultButton = 0;
            nativeConfiguration.nDefaultRadioButton = 0;

            // Various text defaults.
            nativeConfiguration.pszWindowTitle = TaskDialogDefaults.Caption;
            nativeConfiguration.pszMainInstruction = TaskDialogDefaults.MainInstruction;
            nativeConfiguration.pszContent = TaskDialogDefaults.Content;
            nativeConfiguration.pszVerificationText = null;
            nativeConfiguration.pszExpandedInformation = null;
            nativeConfiguration.pszExpandedControlText = null;
            nativeConfiguration.pszCollapsedControlText = null;
            nativeConfiguration.pszFooter = null;
        }
        internal NativeTaskDialogSettings()
        {
            nativeConfiguration = new SafeNativeMethods.TASKDIALOGCONFIG();

            // Apply standard settings.
            nativeConfiguration.cbSize          = (uint)Marshal.SizeOf(nativeConfiguration);
            nativeConfiguration.hwndParent      = SafeNativeMethods.NO_PARENT;
            nativeConfiguration.hInstance       = IntPtr.Zero;
            nativeConfiguration.dwFlags         = SafeNativeMethods.TASKDIALOG_FLAGS.TDF_ALLOW_DIALOG_CANCELLATION;
            nativeConfiguration.dwCommonButtons = SafeNativeMethods.TASKDIALOG_COMMON_BUTTON_FLAGS.TDCBF_OK_BUTTON;
            nativeConfiguration.MainIcon        = new SafeNativeMethods.TASKDIALOGCONFIG_ICON_UNION(0);
            nativeConfiguration.FooterIcon      = new SafeNativeMethods.TASKDIALOGCONFIG_ICON_UNION(0);
            nativeConfiguration.cxWidth         = TaskDialogDefaults.IdealWidth;

            // Zero out all the custom button fields.
            nativeConfiguration.cButtons            = 0;
            nativeConfiguration.cRadioButtons       = 0;
            nativeConfiguration.pButtons            = IntPtr.Zero;
            nativeConfiguration.pRadioButtons       = IntPtr.Zero;
            nativeConfiguration.nDefaultButton      = 0;
            nativeConfiguration.nDefaultRadioButton = 0;

            // Various text defaults.
            nativeConfiguration.pszWindowTitle          = TaskDialogDefaults.Caption;
            nativeConfiguration.pszMainInstruction      = TaskDialogDefaults.MainInstruction;
            nativeConfiguration.pszContent              = TaskDialogDefaults.Content;
            nativeConfiguration.pszVerificationText     = null;
            nativeConfiguration.pszExpandedInformation  = null;
            nativeConfiguration.pszExpandedControlText  = null;
            nativeConfiguration.pszCollapsedControlText = null;
            nativeConfiguration.pszFooter = null;
        }
示例#3
0
        // Configuration is applied at dialog creation time.
        internal NativeTaskDialog( 
            NativeTaskDialogSettings settings,
            TaskDialog outerDialog)
        {
            nativeDialogConfig = settings.NativeConfiguration;
            this.settings = settings;

            // Wireup dialog proc message loop for this instance.
            nativeDialogConfig.pfCallback = 
                new SafeNativeMethods.PFTASKDIALOGCALLBACK(DialogProc);

            // Keep a reference to the outer shell, so we can notify.
            this.outerDialog = outerDialog;
        }
示例#4
0
        // Configuration is applied at dialog creation time.
        internal NativeTaskDialog(
            NativeTaskDialogSettings settings,
            TaskDialog outerDialog)
        {
            nativeDialogConfig = settings.NativeConfiguration;
            this.settings      = settings;

            // Wireup dialog proc message loop for this instance.
            nativeDialogConfig.pfCallback =
                new SafeNativeMethods.PFTASKDIALOGCALLBACK(DialogProc);

            // Keep a reference to the outer shell, so we can notify.
            this.outerDialog = outerDialog;
        }
示例#5
0
 internal static extern HRESULT TaskDialogIndirect(
     [In] SafeNativeMethods.TASKDIALOGCONFIG pTaskConfig,
     [Out] out int pnButton,
     [Out] out int pnRadioButton,
     [MarshalAs(UnmanagedType.Bool)][Out] out bool pVerificationFlagChecked);