怎么单击_GUICtrlToolbar_Create上的_GUICtrlToolbar_AddButton运行一个EXE文件
#include <GuiToolbar.au3>#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
$Debug_TB = False
Global Const $exit = -3
Local Enum $idSave
;~ Opt("guioneventmode",1)
$hgui = GUICreate("1",500, 300)
$toolbar = _GUICtrlToolbar_Create($hgui,0)
_GUICtrlToolbar_AddBitmap ($toolbar, 1, -1, $IDB_STD_LARGE_COLOR )
$Button1 = _GUICtrlToolbar_AddButton($toolbar,$idSave , $STD_FILENEW)
$Button2 = _GUICtrlToolbar_AddButton($toolbar,"" , $STD_FILEOPEN)
$Button3 = _GUICtrlToolbar_AddButton($toolbar,"" , $STD_FILESAVE)
;~ $Button4 = _GUICtrlToolbar_AddButton($toolbar,"" , $STD_FILESAVE)
GUISetState(@SW_SHOW)
While 1
$gui = GUIGetMsg()
Select
Case $gui = $exit
ExitLoop
EndSelect
WEnd
GUIDelete() #include <Constants.au3>
#include <GuiToolbar.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
$Debug_TB = False
Global $iItem
Global Const $exit = -3
Local Enum $idSave
$hgui = GUICreate("", 500, 300)
$toolbar = _GUICtrlToolbar_Create($hgui, 0)
_GUICtrlToolbar_AddBitmap($toolbar, 1, -1, $IDB_STD_LARGE_COLOR)
$Button1 = _GUICtrlToolbar_AddButton($toolbar, $idSave, $STD_FILENEW)
$Button2 = _GUICtrlToolbar_AddButton($toolbar, "", $STD_FILEOPEN)
$Button3 = _GUICtrlToolbar_AddButton($toolbar, "", $STD_FILESAVE)
GUISetState()
GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY")
While 1
$gui = GUIGetMsg()
Switch $gui
Case - 3
ExitLoop
EndSwitch
WEnd
GUIDelete()
Func _WM_NOTIFY($hWndGUI, $MsgID, $wParam, $lParam)
Local $tNMHDR, $code
$tNMHDR = DllStructCreate($tagNMHDR, $lParam)
$code = DllStructGetData($tNMHDR, "Code")
If $code = $NM_LDOWN Then MsgBox(0, '', '')
EndFunc ;==>_WM_NOTIFY 谢谢,我去研究下
页:
[1]