Hallo Leute,
ich bin's mal wieder! In meinem Script soll eine Progress Bar in der Statusleiste aktualisiert werden, leider fuktioniert das nicht ! Das Programm soll einen Countdown fürs Herunterfahren in Form einer Progress Bar in der Statusleiste anzeigen. Leider geht die Progress Bar nur auf ca. 20 Prozent oder auf zeigt keine Reaktion und führt dann den Code aus, der eigentlich erst nach 100 Prozent kommen sollte! Vielleicht könnt ihr euch mal den Code ansehen.
Hier ist mein Code (Unwichtiges hab' ich weggelassen).
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Process.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Herunterfahren", 362, 155, 236, 123, "", $WS_EX_TOOLWINDOW)
$Radio5 = GUICtrlCreateRadio("&Countdown", 32, 74, 87, 17)
$Button1 = GUICtrlCreateButton("&Initialisieren", 130, 10, 100, 30)
$Button2 = GUICtrlCreateButton("&Schließen", 230, 10, 100, 30)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$counter = 0
$StatusBar1 = _GUICtrlStatusBar_Create($Form1)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $Button2
Exit
Case $msg = $Button1
If GUICtrlRead($Radio5) = $GUI_CHECKED Then
;Für den Countdown zuständig
$progress = GUICtrlCreateProgress(0, 0, -1, -1)
$hProgress = GUICtrlGetHandle($progress)
_GUICtrlStatusBar_EmbedControl($StatusBar1, "", $hProgress)
GUICtrlSetData($progress, 0)
$r = GUICtrlRead($input)
$y = $r / 100
For $i = 0 To 100
$x = $y * $i
GUICtrlSetData($progress, $x)
Sleep($y)
Next
MsgBox(0, "Fertig!", "Hat geklappt!")
Exit
;Ende des Countdown-Bereichs
EndIf
;Buttons auf Klick abfragen start
Case $msg = $Radio5
$counter = $counter + 1
$input = GUICtrlCreateInput("", 140, 74, 50, 20)
$Updown = GUICtrlCreateUpdown($input)
EndSelect
WEnd