Hallo,
wie schaffe ich es das sich die Progressbar füllt und die Zeit runterläuft ?
Spoiler anzeigen
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$fill = 15000
[/autoit] [autoit][/autoit] [autoit]GUICreate("My GUI")
[/autoit] [autoit][/autoit] [autoit]GUISetState()
$ID_1 = GUICtrlCreateButton("Countdown", 10, 20, 100)
$ID_2 = GUICtrlCreateButton("Progress", 10, 50, 100)
$progress = GUICtrlCreateProgress(60, 0, 200, 20)
While 1
$msg = GUIGetMsg()
Switch $msg
Case $ID_1
_sleep(30000)
Case $ID_2
_fill()
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _sleep($time)
$tstart = TimerInit()
$stime = $time
Do
GUICtrlCreateLabel("Zeit : " & $stime / 1000 & "sec", 0, 0)
Sleep(1000)
$stime -= 1000
Until TimerDiff($tstart) >= $time
EndFunc ;==>_sleep
Func _fill()
For $x = 0 To 15000
$test = $x ^ 2
GUICtrlSetData($progress, $x * (100 / $fill))
Next
EndFunc ;==>_fill
Das ganze sollte möglichst Synchron laufen.
GUI beenden geht auch nicht solange Progress bzw. Countdown läuft.
Vieleicht gibs da noch eine besssere Lösung wie mein Versuch ?
Danke im voraus
Gruß
Abraham