F12 开始
F11 停止
Ctrl+Esc 退出#Include <HotKey.au3>
Global Const $VK_ESCAPE = 0x1B
Global Const $VK_F12 = 0x7B
Global Const $VK_F11 = 0x7A
Global $testFlg
_HotKeyAssign($VK_F12, 'test', $HK_FLAG_DEFAULT)
_HotKeyAssign($VK_F11, 'test2', $HK_FLAG_DEFAULT)
; Assign "CTRL-ESC" with Quit()
_HotKeyAssign(BitOR($CK_CONTROL, $VK_ESCAPE), 'Quit')
While 1
Sleep(10)
WEnd
Func Quit()
Exit
EndFunc ;==>Quit
Func test()
GUICreate("",100,100,-1,-1,0x80000000)
GUICtrlCreateLabel("",0,0,100,100,0x0201)
GUICtrlSetFont(-1,30)
GUISetState()
Local $io=0
$testFlg = True
While $testFlg
Sleep(100)
$io += 1
GUICtrlSetData(-1,$io)
WEnd
GUIDelete()
EndFunc
Func test2()
$testFlg=False
EndFunc
|