Hi,
I wish to create a GUI that shows a countdown but stays in the background as infobox while other tasks continue. So far I have with use of other snippets from the forum created a countdown but the GUI seems block the script from continuing. How can I 'deactivate' the GUI but keep the countdown running? The GUI box should close at the end of the main script (or after countdown end).
Thanks for help,
mati
#include <GUIConstants.au3>
#include <Date.au3>
$sNewDate = _DateAdd('n', 1, _NowCalc())
$ms = 61000 ;(1 min)
$timer = TimerInit()
$labeltext1 = "This run will be finished in"
$labeltext2 = "minutes at: " & _DateTimeFormat($sNewDate, 3)
;
$GUI = GUICreate("Next start", 170, 170, 150,150, $WS_DLGFRAME, $WS_EX_TOPMOST)
$Install = GUICtrlCreateButton ("Ok", 50, 95, 50, 50, $BS_DEFPUSHBUTTON)
$Label1 = GUICtrlCreateLabel($labeltext1, 10, 10, 330, 200)
$Label2 = GUICtrlCreateLabel($labeltext2, 25, 80, 330, 200)
$Input = GUICtrlCreateInput("", 50, 40, 35, 20, BitOR($SS_CENTER, $ES_READONLY))
$aWin = WinGetPos($GUI)
GUISetState(@SW_SHOWNOACTIVATE)
While (TimerDiff($timer) < $ms) and (GUIGetMsg() <> $Install)
;
$seconds = TimerDiff($timer) / 1000
$diff = $seconds - ($ms / 1000)
;
$minutes = Int($diff / 60)
$secondsRem = $diff - ($minutes * 60)
;
$minutes = $minutes * -1
$secondsRem = $secondsRem * -1
$time = StringFormat("%02d", $minutes) & ":" & StringFormat("%02d", $secondsRem)
;
GUICtrlSetData($Input, $time)
;
WEnd
; just for test purpose
WinActivate("AutoIt Help (v3.3.14.2)")
WinWaitActive("AutoIt Help (v3.3.14.2)")
WinClose("AutoIt Help (v3.3.14.2)")