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; }
/// <summary> /// 指定したフラグが設定されているかどうかを判定する値を取得します。 /// </summary> /// <param name="checkFlag">判定するフラグ。</param> /// <returns>フラグが設定されている場合は<c>true</c>。されていない場合は<c>false</c>。</returns> internal bool GetFlag(TASKDIALOG_FLAGS checkFlag) { return((this.Flags & checkFlag) == checkFlag); }
private void SetFlag(TASKDIALOG_FLAGS flag, bool value) { EnsureNotShowing(); if (value) config.dwFlags |= flag; else config.dwFlags &= ~flag; }
/* /// <summary> /// Version 6.00 and Windows 7. Indicates that the width of the task dialog /// is determined by the width of its content area. This flag is ignored if /// cxWidth is not set to 0. /// /// Note: This flag may not be supported in future versions of Comctl32.dll. /// Also, this flag is not defined in commctrl.h. To use it, add the /// following definition to the source files of your application: /// #define TDIF_SIZE_TO_CONTENT 0x1000000. /// </summary> public bool SizeToContent { get { return TestFlag(TASKDIALOG_FLAGS.TDIF_SIZE_TO_CONTENT); } set { SetFlag(TASKDIALOG_FLAGS.TDIF_SIZE_TO_CONTENT, value); } } */ private bool TestFlag(TASKDIALOG_FLAGS flag) { return (config.dwFlags & flag) == flag; }