Hi PB Team,
It would be nice to have for ExplorerTreeGadget(), not only #PB_Directory_Documents, but also the other virtual folders (if possible ?)
#PB_Directory_Desktop
#PB_Directory_Downloads
#PB_Directory_Pictures
#PB_Directory_Musics
#PB_Directory_Videos
#PB_Directory_Public
So flag to disable it, like: _NoMyDocuments
#PB_Explorer_NoMyDocuments : The 'My Documents' Folder will not be displayed as a separate item.
Thank's
Other virtual folders for ExplorerTreeGadget()
- RSBasic
- Moderator
- Posts: 1218
- Joined: Thu Dec 31, 2009 11:05 pm
- Location: Gernsbach (Germany)
- Contact:
Re: Other virtual folders for ExplorerTreeGadget()
I don't know if this wish function will be implemented, otherwise with own code?
Example:
(Only Windows and my example code is incomplete.)
Example:
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
- Kwai chang caine
- Always Here
- Posts: 5342
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: Other virtual folders for ExplorerTreeGadget()
Yes but it works, thanks for sharingand my example code is incomplete
The happiness is a road...
Not a destination
Not a destination