public void ShowDialog(IntPtr owner) { var config = new TaskDialogConfig { pszWindowTitle = "Task dialog sample", pszMainInstruction = "This is an example task dialog.", pszContent = "(Content goes here)", pszExpandedInformation = "(Expanded information goes here)", pszFooterText = "(Footer text goes here)", hwndParent = owner, dwCommonButtons = TaskDialogCommonButtonFlags.OkButton | TaskDialogCommonButtonFlags.CancelButton, dwFlags = TaskDialogFlags.NoDefaultRadioButton, cbSize = (uint)Marshal.SizeOf(typeof(TaskDialogConfig)) }; using (new ComCtlv6ActivationContext(enable: true)) { TaskDialogIndirect(ref config, out _, out _, out _); } }
private static extern void TaskDialogIndirect([In] ref TaskDialogConfig pTaskConfig, out int pnButton, out int pnRadioButton, [MarshalAs(UnmanagedType.Bool)] out bool pfVerificationFlagChecked);