#Include once "window9.bi"

Function ProgressBarGadget(ByVal gadget As Integer, ByVal x As Integer,ByVal y As Integer,ByVal Width_ As Integer,ByVal height_ As Integer,ByVal BeginPos As Integer,ByVal EndPos As Integer,byval Style As Integer=0) As HWND Export
  Dim As HWND wnd = CreateWindowEx( 0, PROGRESS_CLASS, "", WS_CHILD Or WS_VISIBLE Or Style, x, y, Width_,height_ ,GETGURRENTAL(),Cast(HMENU,gadget) , 0, 0 )
  ADDIN9999(gadget,wnd)
  ColorAdd(wnd,0,0)
  If EndPos<>0 Then
    SendMessage(wnd, PBM_SETRANGE, 0,MAKELPARAM(BeginPos, EndPos))
  EndIf
  Return wnd
End Function

Function SetRangeProgressBar(ByVal gadget As integer,ByVal BeginPos As Integer,ByVal EndPos As Integer) As Integer Export
  Return SendMessage(GadgetID(gadget), PBM_SETRANGE, 0,MAKELPARAM(BeginPos, EndPos))
End Function

Function SetXProgressBarColor(ByVal gadget As Integer,ByVal farbe As Integer) As Integer Export
  Return SendMessage(GadgetID(gadget),WM_USER+16,farbe,0)
End Function

