#Include once "window9.bi"

Function SpinGadget(ByVal gadget As Integer,ByVal x As Long,ByVal y As Long,ByVal w As Long,ByVal h As Long, _
                    ByVal maxvalue As Long,ByVal minvalue As Long,ByVal curvalue As Long,ByVal style As Long,ByVal style2 As Long) As HWND Export
  var parent = CreateWindowEx(WS_EX_CLIENTEDGE,"Edit","",WS_CHILD   Or WS_CLIPSIBLINGS Or WS_VISIBLE Or ES_AUTOHSCROLL Or WS_TABSTOP Or style2, _
                              x,y,w,h,GETGURRENTAL(),NULL,0,NULL)
  Var wnd  = CreateUpDownControl(WS_CHILD Or WS_CLIPSIBLINGS Or WS_BORDER Or WS_VISIBLE Or WS_TABSTOP Or Style,x,y,w,h, _
                                GETGURRENTAL(),gadget,0,parent,maxvalue,minvalue,curvalue)
  ADDIN9999 (gadget,parent)
  SetProp(parent,"addparam60000",wnd)
  ColorAdd(parent,15790320,0)

  If GGF()<>0 Then
    SendMessage(parent ,WM_SETFONT,GGF(),0)
  EndIf
  Return wnd
End Function
