_WinAPI_MessageBoxIndirect
netegg 发表于 2012-1-10 16:08
确实可以。这是官网的例子:#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=Arrow.ico
#AutoIt3Wrapper_Res_Icon_Add=Arrow.ico
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#Include <Constants.au3>
#Include <WinAPIEx.au3>
Opt('MustDeclareVars', 1)
Global Const $MB_USERICON = 0x80
Global Const $sTitle = 'Message'
Global Const $sText = 'This is a simple message box with a custom icon.'
Global $tMBP = DllStructCreate($tagMSGBOXPARAMS)
Global $tTitle = DllStructCreate('wchar[' & (StringLen($sTitle) + 1) & ']')
Global $tText = DllStructCreate('wchar[' & (StringLen($sText) + 1) & ']')
Global $Result
DllStructSetData($tTitle, 1, $sTitle)
DllStructSetData($tText, 1, $sText)
DllStructSetData($tMBP, 'Size', DllStructGetSize($tMBP))
DllStructSetData($tMBP, 'hOwner', 0)
DllStructSetData($tMBP, 'hInstance', _WinAPI_GetModuleHandle(0))
DllStructSetData($tMBP, 'Text', DllStructGetPtr($tText))
DllStructSetData($tMBP, 'Caption', DllStructGetPtr($tTitle))
DllStructSetData($tMBP, 'Style', BitOR($MB_OKCANCEL, $MB_USERICON))
DllStructSetData($tMBP, 'Icon', 201)
DllStructSetData($tMBP, 'ContextHelpId', 0)
DllStructSetData($tMBP, 'MsgBoxCallback', 0)
DllStructSetData($tMBP, 'LanguageId', 0)
$Result = _WinAPI_MessageBoxIndirect($tMBP)
MsgBox(0, 'Result', 'Return: ' & $Result & @CR)
|