1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
enum TaskDialog_Common_Button_Flags { TDCBF_OK_BUTTON = 0x0001, TDCBF_YES_BUTTON = 0x0002, TDCBF_NO_BUTTON = 0x0004, TDCBF_CANCEL_BUTTON = 0x0008, TDCBF_RETRY_BUTTON = 0x0010, TDCBF_CLOSE_BUTTON = 0x0020 };
public enum TaskDialog_Result { FAILED = 0, IDOK = 1, IDCANCEL = 2, IDRETRY = 4, IDYES = 6, IDNO = 7, };
public enum TaskDialogIcon { Information = UInt16.MaxValue - 2, Warning = UInt16.MaxValue, Stop = UInt16.MaxValue - 1, Question = 0, SecurityWarning = UInt16.MaxValue - 5, SecurityError = UInt16.MaxValue - 6, SecuritySuccess = UInt16.MaxValue - 7, SecurityShield = UInt16.MaxValue - 3, SecurityShieldBlue = UInt16.MaxValue - 4, SecurityShieldGray = UInt16.MaxValue - 8 } [DllImport("comctl32.dll", CharSet = CharSet.Unicode, EntryPoint = "TaskDialog")] public static extern int TaskDialog( IntPtr hwndParent, IntPtr hInstance, String pszWindowTitle, String pszMainInstruction, String pszContent, Int32 dwCommonButtons, IntPtr pszIcon, out int pnButton);
public void TaskDialogCallTest(IntPtr a_Handle) { IntPtr hwndPtr = a_Handle; String msgTitle = "タイトル"; String msgMain = "主文"; String msgContent = "補足"; int idButtonMsg = (int)(TaskDialog_Common_Button_Flags.TDCBF_CANCEL_BUTTON | TaskDialog_Common_Button_Flags.TDCBF_OK_BUTTON); int resultSelectButton; IntPtr icon = new IntPtr((int)(TaskDialogIcon.SecurityShieldBlue)); int iRet = TaskDialog(hwndPtr, IntPtr.Zero, msgTitle, msgMain, msgContent, idButtonMsg, icon, out resultSelectButton); } |