
#PB_Directory_Desktop
#PB_Directory_Downloads
#PB_Directory_Pictures
#PB_Directory_Musics
#PB_Directory_Videos
#PB_Directory_Public

#PB_Explorer_NoMyDocuments : The 'My Documents' Folder will not be displayed as a separate item.
Thank's

Code: Select all
EnableExplicit
Procedure AddTreeGadgetSpecialItem(Gadget, ItemText$, Image)
Protected TV_INSERTSTRUCT.TV_INSERTSTRUCT
Protected ImageList
Protected ItemIcon
ImageList = SendMessage_(GadgetID(Gadget), #TVM_GETIMAGELIST, #TVSIL_NORMAL, 0)
ItemIcon = ImageList_AddIcon_(ImageList, Image)
TV_INSERTSTRUCT\hParent = 0
TV_INSERTSTRUCT\hInsertAfter = #TVI_FIRST
TV_INSERTSTRUCT\Item\Mask = #TVIF_TEXT | #TVIF_IMAGE | #TVIF_SELECTEDIMAGE
TV_INSERTSTRUCT\Item\pszText = @ItemText$
TV_INSERTSTRUCT\Item\cchTextMax = Len(ItemText$)
TV_INSERTSTRUCT\item\iImage = ItemIcon
TV_INSERTSTRUCT\item\iSelectedImage = ItemIcon
SendMessage_(GadgetID(Gadget), #TVM_INSERTITEM, 0, TV_INSERTSTRUCT)
ImageList_Destroy_(ImageList)
EndProcedure
If OpenWindow(0, 0, 0, 500, 400, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ExplorerTreeGadget(1, 0, 0, WindowWidth(0), WindowHeight(0), "", 0)
AddTreeGadgetSpecialItem(1, "Desktop", ExtractIcon_(GetModuleHandle_(0), "imageres.dll", 125))
AddTreeGadgetSpecialItem(1, "Downloads", ExtractIcon_(GetModuleHandle_(0), "imageres.dll", 175))
AddTreeGadgetSpecialItem(1, "Pictures", ExtractIcon_(GetModuleHandle_(0), "imageres.dll", 108))
AddTreeGadgetSpecialItem(1, "Musics", ExtractIcon_(GetModuleHandle_(0), "imageres.dll", 103))
AddTreeGadgetSpecialItem(1, "Videos", ExtractIcon_(GetModuleHandle_(0), "imageres.dll", 178))
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
End
EndSelect
ForEver
EndIf
Yes but it works, thanks for sharingand my example code is incomplete