Skip to content

Instantly share code, notes, and snippets.

@kumatti1
Created February 1, 2012 02:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kumatti1/1714700 to your computer and use it in GitHub Desktop.
Save kumatti1/1714700 to your computer and use it in GitHub Desktop.
VBAでのTaskDialog(Win7SP1)
Option Explicit
Enum ICONS
TD_WARNING_ICON = 65535
TD_ERROR_ICON = 65534
TD_INFORMATION_ICON = 65533
TD_SHIELD_ICON = 65532
End Enum
Enum TASKDIALOG_COMMON_BUTTON_FLAGS
TDCBF_OK_BUTTON = &H1
TDCBF_YES_BUTTON = &H2
TDCBF_NO_BUTTON = &H4
TDCBF_CANCEL_BUTTON = &H8
TDCBF_RETRY_BUTTON = &H10
TDCBF_CLOSE_BUTTON = &H20
End Enum
Declare Function TaskDialog& Lib "C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2\comctl32.dll" (ByVal hWndParent&, ByVal hInstance&, ByVal pszWindowTitle&, ByVal pszMainInstruction&, ByVal pszContent&, ByVal dwCommonButtons&, ByVal pszIcon&, ByVal pnButton&)
Sub hoge()
Dim ret&
TaskDialog Application.Hwnd, 0, _
StrPtr("タイトル"), _
StrPtr("hoge"), _
StrPtr("foo"), _
TDCBF_OK_BUTTON, _
TD_WARNING_ICON, _
VarPtr(ret)
Debug.Print ret
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment