Hallo Community
Habe hier im Forum viele schöne Beispiele von Progressbars gesehen.
Zum Beispiel:
autoit.de/wcf/attachment/4173/
Das zugehörige GUI-Script:
Spoiler anzeigen
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
Opt('MustDeclareVars', 1)
Example()
Func Example()
Local $progressbar1, $button, $wait, $s, $msg, $m
GUICreate("My GUI Progressbar", 500, 100, 100, 200)
$progressbar1 = GUICtrlCreateProgress(10, 10, 480, 20); Fortschrittsbalken
$button = GUICtrlCreateButton("Start", 60, 50, 80, 30)
GUISetState()
$wait = 20; wait 20ms for next progressstep
$s = 0; progressbar-saveposition
Do
$msg = GUIGetMsg()
If $msg = $button Then
GUICtrlSetData($button, "Stop")
For $i = $s To 100
$m = GUIGetMsg()
If $m = -3 Then ExitLoop
If $m = $button Then
GUICtrlSetData($button, "Weiter")
$s = $i;save the current bar-position to $s
ExitLoop
Else
$s = 0
GUICtrlSetData($progressbar1, $i)
Sleep($wait)
EndIf
Next
If $i > 100 Then
GUICtrlSetData($button, "Start")
EndIf
EndIf
Until $msg = $GUI_EVENT_CLOSE
EndFunc ;==>Example
Wie kann man in dieses GUI-Script einen Schalter einbauen der die ISO-Erstellung per CMD-Befehl und den Fortschrittsbalken beim Klick auf "Start" gleichzeitig startet ?
Mein CMD-Befehl:
Spoiler anzeigen
#include <Process.au3>
$command = "OSCDIMG.exe -lGRUB -h -n -m -o ""C:\GRUB"" ""D:\IMAGES\GRUB-090324.iso"""
_runDOS($command)
Wenn es eine einfachere Progressbar gibt ist das auch OK, Hauptsache jemand zeigt mir wie ich sie gleichzeizig in Gang setze.
Für jeden noch so kleinen Hinweis bin ich Euch schon dankbar !
Gruß M.