|
发表于 2022-12-16 16:22:30
|
显示全部楼层
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 254, 323, 664, 210)
$Edit1 = GUICtrlCreateEdit("", 32, 32, 193, 97)
GUICtrlSetData(-1, "show logging error重覆60次" & @CRLF & "總時1h1分鐘1次")
$Button1 = GUICtrlCreateButton("logging error", 40, 144, 139, 57)
$Button2 = GUICtrlCreateButton("stop", 40, 224, 139, 57)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
Global $ts = 0
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$ts = 1
For $i = 1 To 60
If $ts = 0 Then
ExitLoop
Else
GUICtrlSetData($Edit1, "show logging error " & $i)
Sleep(1000)
EndIf
Next
EndSwitch
WEnd
Func WM_COMMAND($hWnd, $msg, $wParam, $lParam)
#forceref $hWnd, $msg
Local $nNotifyCode = BitShift($wParam, 16)
Local $nID = BitAND($wParam, 0x0000FFFF)
Local $hCtrl = $lParam
Switch $hCtrl
Case GUICtrlGetHandle($Button2)
$ts = 0
EndSwitch
EndFunc ;==>WM_COMMAND
|
|