#Include Once "window9.bi"

Function TreeViewGadget(ByVal gadget As Integer, ByVal x As Integer,ByVal y As Integer,ByVal Width_ As Integer,ByVal height_ As Integer, _
                        ByVal par As Integer= 0,ByVal par2 As Integer=0,ByVal SizeIcon As Integer=16) As HWND Export
  
  Var hhh = CreateWindowEx( par2, WC_TREEVIEW, "", WS_CHILD Or WS_VISIBLE  Or par , x, y,Width_,height_,GETGURRENTAL(),Cast(HMENU,gadget),0,0)
  ADDIN9999 (gadget,hhh)
  ColorAdd(hhh,16777215,0)
  'COOLOOR(16777215,0)
  If GGF()<>0 Then
    SendMessage(hhh,WM_SETFONT,GGF(),0)
  EndIf
  Dim As hImageList ImageList = ImageList_Create(SizeIcon,SizeIcon,ILC_COLOR32 Or ILC_MASK,1,1)
  SetProp(hhh,"addparam60000",ImageList)
  ImageList_SetBkColor(ImageList, TreeView_GetBkColor(hhh))
  'TreeView_SetImageList( hhh, ImageList, TVSIL_NORMAL )
  'ImageList_SetBkColor(ImageList,&hffffff)
  SendMessage(hhh,TVM_SETIMAGELIST,TVSIL_NORMAL,Cast(LPARAM,ImageList))
  Return hhh
End Function
