Hilfe eine einfache Progressbar erstellt mit Koda

  • Hallo an Alle!

    Ich habe mit Hilfe des Kodas ein Progressbar erstellt. doch ich weiß nicht weiter möchte gern ein kleinen beispiel Script.

    Ich Stelle es mir so vor das eine exe datei von über fileinstall aus nach dem temp ordner kopiert wird und die progressbar mir den fortschritt anzeigt wie weit die datei schon kopiert ist.

    würde dir mir bestimmt weiter helfen da ich mit den progressbar noch nicht gearbeitet habe. :whistling:

    gruß Baron

  • Schau dir das Script aus der Hilfe mal an:


    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Opt('MustDeclareVars', 1)

    [/autoit] [autoit][/autoit] [autoit]

    Example()

    [/autoit] [autoit][/autoit] [autoit]

    Func Example()
    Local $progressbar1, $progressbar2, $button, $wait, $s, $msg, $m

    GUICreate("My GUI Progressbar", 220, 100, 100, 200)
    $progressbar1 = GUICtrlCreateProgress(10, 10, 200, 20)
    GUICtrlSetColor(-1, 32250); not working with Windows XP Style
    $progressbar2 = GUICtrlCreateProgress(10, 40, 200, 20, $PBS_SMOOTH)
    $button = GUICtrlCreateButton("Start", 75, 70, 70, 20)
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    $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
    If GUICtrlRead($progressbar1) = 50 Then MsgBox(0, "Info", "The half is done...", 1)
    $m = GUIGetMsg()

    If $m = -3 Then ExitLoop

    If $m = $button Then
    GUICtrlSetData($button, "Next")
    $s = $i;save the current bar-position to $s
    ExitLoop
    Else
    $s = 0
    GUICtrlSetData($progressbar1, $i)
    GUICtrlSetData($progressbar2, (100 - $i))
    Sleep($wait)
    EndIf
    Next
    If $i > 100 Then
    ; $s=0
    GUICtrlSetData($button, "Start")
    EndIf
    EndIf
    Until $msg = $GUI_EVENT_CLOSE
    EndFunc ;==>Example

    [/autoit]

    Wobei das mit FileInstall nicht gehen dürfte, weil diese Dateien vor dem Ausführen des eigentlichen Scriptes entpackt werden.

    Andy hat mir ein Schnitzel gebacken aber da war ein Raupi drauf und bevor Oscar das Bugfixen konnte kam Alina und gab mir ein AspirinJunkie.