#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <SMT.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1_test", 623, 442, 192, 124)
$Button1 = GUICtrlCreateButton("Button1", 344, 256, 121, 49)
$BL = GUICtrlCreateLabel('', 50, 50, 200, 20)
GUICtrlCreateLabel('SLEEP(1000)所用时间!', 250, 50, 200, 20)
$BL0 = GUICtrlCreateLabel('', 50, 80, 200, 20)
GUICtrlCreateLabel('一个循环所用时间', 250, 80, 200, 20)
$BL1 = GUICtrlCreateLabel('', 50, 110, 200, 25)
GUICtrlCreateLabel('模拟点击后等待时间', 250, 110, 200, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$time = 0
$time0 = 0
AdlibRegister('showtime', 100)
$pid = _CreateThread('hahaha')
While 1
$test0 = TimerInit()
$nMsg = GUIGetMsg()
If $nMsg = $GUI_EVENT_CLOSE Then Exit
If $nMsg = $Button1 Then MsgBox(0, "hahaha", "ok")
$test = TimerInit()
Sleep(1000);为什么加入的是1秒 要等15秒才反应
$time = TimerDiff($test)
$time0 = TimerDiff($test0)
WEnd
Func showtime()
GUICtrlSetData($BL0, $time0)
GUICtrlSetData($BL, $time)
EndFunc ;==>showtime
Func hahaha()
While 1
ControlSetText('Form1_test', '', 'Static5', '2秒后开始模拟点击!')
Sleep(2000)
ControlClick('Form1_test', '', 'Button1')