Progressbar auf Error stellen

  • Ich möchte meine Progressbar auf Error stellen (eigentlich möchte ich sie nur rot haben). Wie das aussieht, sieht man auf diesem Bild oder wenn beim kopieren von Dateien etwas schief läuft.Leider gibt es keinen Befehl dafür. GUICtrlSetColor funktioiert zumindest bei Vista nicht mit Progressbars.Die UDF von progandy (Progressbar mit GDIplus) wollte ich auch nicht nehmen, da man das ja auch irgendwie anders hinkriegen muss (sieht bei anderen Windows-Versionen auch blöd aus). Sonst hätten die das auf dem Screenshot ja auch nicht hinbekommen. Zudem ist es ja eine ganz normale Funktion.

    Hat irgendjemand eine Ahnung davon oder weiß, wie man das lösen könnte?

    Rechtschreibfehler sind Spezialeffekte meiner Tastatur.

  • Hallo owidowispin,

    klappt dieses kleine Beispiel bei dir?

    Spoiler anzeigen
    [autoit]

    Opt('MustDeclareVars', 1)

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

    Example()

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

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

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

    GUICreate("My GUI Progressbar", 220, 100, 100, 200)

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

    DllCall('uxtheme.dll', 'none', 'SetThemeAppProperties', 'int', 0) ; Classic-Style ;<=============
    $progressbar1 = GUICtrlCreateProgress(10, 10, 200, 20)
    GUICtrlSetColor(-1, 32250); not working with Windows XP Style
    DllCall('uxtheme.dll', 'none', 'SetThemeAppProperties', 'int', 7) ; Standard-Windows-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()

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

    If $m = -3 Then ExitLoop

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

    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]

    (abgeändert aus der Hilfe)

    mfg (Auto)Bert

    Einmal editiert, zuletzt von AutoBert (14. März 2010 um 22:00)


  • Also das funktioniert. Ich kann die Classic-Progressbar einfärben, aber nicht die moderne :(

    Man müsste wissen welche DLL das ist...

    Rechtschreibfehler sind Spezialeffekte meiner Tastatur.