Esempio n. 1
0
        internal NativeTaskDialogSettings()
        {
            nativeConfiguration = new NativeMethods.TASKDIALOGCONFIG();

            // TODO: consider trimming list of defaults down
            // Apply standard settings
            nativeConfiguration.cbSize          = (uint)Marshal.SizeOf(nativeConfiguration);
            nativeConfiguration.hwndParent      = NativeMethods.NO_PARENT;
            nativeConfiguration.hInstance       = IntPtr.Zero;
            nativeConfiguration.dwFlags         = NativeMethods.TASKDIALOG_FLAGS.TDF_ALLOW_DIALOG_CANCELLATION;
            nativeConfiguration.dwCommonButtons = NativeMethods.TASKDIALOG_COMMON_BUTTON_FLAGS.TDCBF_OK_BUTTON;
            nativeConfiguration.MainIcon        = new NativeMethods.TASKDIALOGCONFIG_ICON_UNION(0);
            nativeConfiguration.FooterIcon      = new NativeMethods.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 NativeMethods.TASKDIALOGCONFIG();

            // TODO: consider trimming list of defaults down
            // Apply standard settings
            nativeConfiguration.cbSize = (uint)Marshal.SizeOf(nativeConfiguration);
            nativeConfiguration.hwndParent = NativeMethods.NO_PARENT;
            nativeConfiguration.hInstance = IntPtr.Zero;
            nativeConfiguration.dwFlags = NativeMethods.TASKDIALOG_FLAGS.TDF_ALLOW_DIALOG_CANCELLATION;
            nativeConfiguration.dwCommonButtons = NativeMethods.TASKDIALOG_COMMON_BUTTON_FLAGS.TDCBF_OK_BUTTON;
            nativeConfiguration.MainIcon = new NativeMethods.TASKDIALOGCONFIG_ICON_UNION(0);
            nativeConfiguration.FooterIcon = new NativeMethods.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;
        }
Esempio n. 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 NativeMethods.PFTASKDIALOGCALLBACK(DialogProc);

            // Keep a reference to the outer shell, so we can notify
            this.outerDialog = outerDialog;
        }
Esempio n. 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 NativeMethods.PFTASKDIALOGCALLBACK(DialogProc);

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