I have a window
And i want to start the countdown as soon as the window is created, and count down every second. When the countdown is finished, it should do something, and when $Buttoncount is pressed, it should simply exit the code.
[ autoit ]
$hours = GUICtrlRead($Input1ausin) $mins = GUICtrlRead($Input2ausin) $secs = 00 If $mins <= 60 AND $mins >= 0 Then GUIDelete($Form3) Global $Form4 = GUICreate("Countdown", 263, 153) $Labelcount = GUICtrlCreateLabel($hours, 81, 39, 28, 36, $SS_CENTER) GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif") $Label1count = GUICtrlCreateLabel($mins, 120, 40, 28, 36, $SS_CENTER) GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif") $Label2count = GUICtrlCreateLabel($secs, 160, 40, 28, 36, $SS_CENTER) GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif") $Label3count = GUICtrlCreateLabel(":", 112, 37, 7, 36) GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif") $Label4count = GUICtrlCreateLabel(":", 152, 37, 7, 36) GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif") Global $Buttoncount = GUICtrlCreateButton("Cancel", 83, 104, 97, 25) GUISetState(@SW_SHOW) Else MsgBox(0, "Error", "Invalid time") EndIf ExitLoop