#include once "window9.bi"

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

Sub SetRangeProgressBar(ByVal gadget As Long, ByVal BeginPos As Integer, ByVal EndPos As Integer) Export
	SendMessage(GadgetID(gadget), PBM_SETRANGE, 0,MAKELPARAM(BeginPos, EndPos))
End Sub

Sub SetXProgressBarColor(ByVal gadget As Long, ByVal farbe As long) Export
	SendMessage(GadgetID(gadget),WM_USER+16,CInt(farbe),0)
End Sub

