也不知道对不对!试试吧!
#include <GUIConstantsEx.au3>
Opt('MustDeclareVars', 1)
Global $gui
HotKeySet('a', '_Show')
Example()
Func Example()
Local $Button_1, $Button_2, $msg
$gui = GUICreate("My GUI Button")
Opt("GUICoordMode", 2)
$Button_1 = GUICtrlCreateButton("Button 1", 10, 30, 100)
$Button_2 = GUICtrlCreateButton("Button 2", 0, -1)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $Button_1
MsgBox(0, 'Testing', 'Button 1 was pressed')
Case $msg = $Button_2
MsgBox(0, 'Testing', 'Button 2 was pressed')
EndSelect
WEnd
EndFunc ;==>Example
Func _Show()
GUISetState(@SW_SHOW, $gui)
EndFunc ;==>_Show
|