#include <Array.au3>
#include <GuiListView.au3>
Opt("GUIOnEventMode", 1)
Global Const $GUI_DEFBUTTON = 512
Global Const $GUI_EVENT_CLOSE = -3
$GUI = GUICreate("测试", 640, 540)
GUISetOnEvent($GUI_EVENT_CLOSE, "main")
$menu1 = GUICtrlCreateMenu("文件(&F)")
$runitem = GUICtrlCreateMenuItem("新建任务(&N)", $menu1)
GUICtrlSetOnEvent($runitem, "main")
GUICtrlSetState($runitem, $GUI_DEFBUTTON)
GUICtrlCreateMenuItem("", $menu1)
$exititem = GUICtrlCreateMenuItem("退出程序(&X)", $menu1)
GUICtrlSetOnEvent($exititem, "main")
$menu2 = GUICtrlCreateMenu("帮助(&H)", -1, 1)
$aboutitem = GUICtrlCreateMenuItem("关于(&A)", $menu2)
GUICtrlSetOnEvent($aboutitem, "main")
GUISetState()
While 1
Sleep(100000)
WEnd
Func main()
Switch @GUI_CtrlId
Case $GUI_EVENT_CLOSE, $exititem
Exit
Case $runitem
Send("#r")
Case $aboutitem
MsgBox(0, "ooxx", "按了A键了" & @LF & "BYS" & @LF & "A键启动")
EndSwitch
EndFunc
|