回复 7# 3131210
這樣不就可以了 點擊 開始 然後 F8 停 然後可以再度點擊開始 在按 F8 停
#include <GUIConstants.au3>
$Exists = "网站??工具";判?是否只?行一?程序
If WinExists($Exists) Then
MsgBox(32,"?馨提醒:","注意已??行一?程序了!")
Exit
EndIf
AutoItWinSetTitle($Exists);修改程序窗口的??名
$Reate0 = GUICreate($Exists, 200, 150, 350, 400);主窗口
$Web = GUICtrlCreateButton("??", 120, 25, 70, 20);??按?
$Start = GUICtrlCreateButton("?始(F7)", 120, 119, 70, 20);?始按?
$Stop = GUICtrlCreateButton("停止(F8)", 120, 69, 70, 20);停止按?
GUICtrlCreateLabel ("??器路?", 10, 6, 120)
GUICtrlCreateLabel ("首?网站打?等待??", 10, 50, 120)
GUICtrlCreateLabel ("其余网站打?等待??", 10, 100, 120)
GUICtrlCreateLabel ("?位:毫秒", 55, 72, 60)
GUICtrlCreateLabel ("?位:毫秒", 55, 122, 60)
$first = GUICtrlCreateInput ( "2000", 10, 70 , 40, 18 )
$delay = GUICtrlCreateInput ( "200", 10, 120 , 40, 18)
$address = GUICtrlCreateInput ( "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --incognito", 10, 24, 100, 20)
GUISetState(@SW_SHOW)
HotKeySet("{F7}","test")
HotKeySet("{F8}","teststop")
$ts = 0
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $Web
$var = FileOpenDialog('????器', 'C:\', "程序 (*.exe)", 1)
If Not @error Then
GUICtrlSetData($address, $var)
EndIf
Case $Start
test()
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func test()
If $ts = 1 THEN $ts = 0
$i = 1
While 1
$i = $i + 1
ConsoleWrite($ts&" "&$i&@CRLF)
If $ts = 1 Then ExitLoop
SLEEP(10)
Wend
EndFunc
Func teststop()
$ts = 1
EndFunc
|