#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 356, 218, -1, -1)
$Edit1 = GUICtrlCreateEdit("", 16, 16, 321, 129)
GUICtrlSetData(-1, "Edit1")
$Button1 = GUICtrlCreateButton("显示时间", 80, 168, 75, 25, 0)
$Button2 = GUICtrlCreateButton("退出", 200, 168, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Timer()
Case $Button2
Exit
EndSwitch
WEnd
Func Timer()
Addlog(@HOUR&"时"&@MIN&"分"&@SEC&"秒")
Sleep(1000)
Addlog(@HOUR&"时"&@MIN&"分"&@SEC&"秒")
Sleep(1000)
Addlog(@HOUR&"时"&@MIN&"分"&@SEC&"秒")
Sleep(1000)
Addlog(@HOUR&"时"&@MIN&"分"&@SEC&"秒")
Sleep(1000)
Addlog(@HOUR&"时"&@MIN&"分"&@SEC&"秒")
Sleep(1000)
Addlog(@HOUR&"时"&@MIN&"分"&@SEC&"秒")
Sleep(1000)
Addlog(@HOUR&"时"&@MIN&"分"&@SEC&"秒")
Sleep(1000)
Addlog(@HOUR&"时"&@MIN&"分"&@SEC&"秒")
Sleep(1000)
Addlog(@HOUR&"时"&@MIN&"分"&@SEC&"秒")
Sleep(1000)
Addlog(@HOUR&"时"&@MIN&"分"&@SEC&"秒")
Sleep(1000)
Addlog(@HOUR&"时"&@MIN&"分"&@SEC&"秒")
Sleep(1000)
Addlog(@HOUR&"时"&@MIN&"分"&@SEC&"秒")
Sleep(1000)
Addlog(@HOUR&"时"&@MIN&"分"&@SEC&"秒")
EndFunc
Func Addlog ($lcStr)
GUICtrlSetData($Edit1,GUICtrlRead($Edit1)&@CRLF&$lcStr)
GUICtrlSetData($Edit1," ",True)
EndFunc
|