$I ProgressBar.inc
DEF @GetSysColor(1) !"USER32","GetSysColor"
Windowstyle 24
Windowtitle "Demo ProgressBar.inc - Copyright by Julian Schmidt"
Window (%maxx-470)/2,(%maxy-335-30)/2-470,335

Set("Decimals",1)

var PBar1&=CreateProgressBar(%hwnd,0,1,70,20,width(%hwnd)-90,30,"0;0;1000") 'ProgressBar erstellen
var PBar2&=CreateProgressBar(%hwnd,1,0,20,20,30,height(%hwnd)-40,"1000;0;1000")
var button1&=Create("Button",%hwnd,"Auf 50% Setzen",70,150,140,25)
var button2&=Create("Button",%hwnd,"Auf 100 Setzen",70,180,140,25)
var button3&=Create("Button",%hwnd,"Um 5% erhöhen",70,210,140,25)
var button4&=Create("Button",%hwnd,"Um 5% erniedrigen",70,240,140,25)
var button5&=Create("Button",%hwnd,"Design-Wechsel",width(%hwnd)-150,55,130,25)
SetDesignProgressBar(PBar2&,0) 'Design der ProgressBar Setzen
var design&=1

While 1
    Sleep 30
    case IsCompletelyFilledProgressBar(PBar1&) : break 'Wenn zu 100% Ausgefüllt
    case IsCompletelyBlankProgressBar(PBar2&) : break 'Wenn zu 100% Unausgefüllt
    If getfocus(button1&)
        SetPercentProgressBar(PBar2&,50) 'PrrogressBar auf 50% setzen
        Setfocus(%hwnd)
    elseif getfocus(button2&)
        SetPosProgressBar(PBar2&,100) 'ProgressBar auf 100 setzen
        Setfocus(%hwnd)
    elseif getfocus(button3&)
        PercentUpProgressBar(PBar2&,5) 'ProgressBar um 5% erhöhen
        Setfocus(%hwnd)
    elseif getfocus(button4&)
        PercentDownProgressBar(PBar2&,5) 'ProgressBar um 5% erniedrigen
        Setfocus(%hwnd)
    elseif getfocus(button5&)
        Randomize
        SetDesignProgressBar(PBar1&,design&,RND(256*256*256),RND(256*256*256))
        case design&=0 : design&=3
        case design&=1 : design&=0
        case design&=3 : design&=1
        Setfocus(%hwnd)
    Endif
    UseCursor 0
    SetProgressbarByMouse(PBar1&) 'Setzen per Maus
    SetProgressbarByMouse(PBar2&) 'Setzen per Maus
    StepUpProgressBar(PBar1&,2) 'ProgressBar um 2 Schritte erhöhen
    StepDownProgressBar(PBar2&,1) 'ProgressBar um 1 Schritt erniedrigen
    locate 5,10
    print GetPosProgressBar(PBar1&);" von ";GetRangeProgressbar(PBar1&,2);" = ";GetPercentProgressBar(PBar1&);"%"
    locate 22,10
    print GetPosProgressBar(PBar2&);" von ";GetRangeProgressbar(PBar2&,2);" = ";GetPercentProgressBar(PBar2&);"%"
Endwhile
end