I wrote this code, WinXP run OK, however Win7 don't display My Document to My Picture, My Video, My Music, and etc.
Could you tell me about solution?
Advanced Path Requester ( Multi Path Requester ) Tips
http://forum.purebasic.com/english/view ... 12&t=48990
Thank you
[Win7] ExplorerTreeGadget, Where My picture?
Re: [Win7] ExplorerTreeGadget, Where My picture?
My Documents is at the bottom of the list.
----
R Tape loading error, 0:1
R Tape loading error, 0:1
Re: [Win7] ExplorerTreeGadget, Where My picture?
Don't display My picture, My video, My musinc in my document on Windows7.
But My win7 pc did display it, only my father pc didn't display.
I use compiler option by Reqest user mode, but not change.
Where my picture?
But My win7 pc did display it, only my father pc didn't display.
I use compiler option by Reqest user mode, but not change.
Where my picture?
Re: [Win7] ExplorerTreeGadget, Where My picture?
Hi oryaaaaa
The rest is yours
Code: Select all
#TVGN_LASTVISIBLE = 10
Procedure AddItem(gadget.l, text.s)
hRoot = SendMessage_(GadgetID(gadget), #TVM_GETNEXTITEM, #TVGN_LASTVISIBLE, 0)
lpis.TV_INSERTSTRUCT
lpis\hParent = SendMessage_(GadgetID(gadget), #TVM_GETNEXTITEM, #TVGN_PARENT, hRoot)
lpis\hInsertAfter = hRoot
lpis\item\mask = #TVIF_TEXT
lpis\item\cchTextMax = Len(text)
lpis\item\pszText = @text
SendMessage_(GadgetID(gadget), #TVM_INSERTITEM, 0, @lpis)
EndProcedure
OpenWindow(0, 0, 0, 300, 350, "ExplorerTreeGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ExplorerTreeGadget(0, 10, 10, 280, 280, "*.*")
SetWindowLongPtr_(GadgetID(0), #GWL_STYLE, GetWindowLongPtr_(GadgetID(0), #GWL_STYLE) | #TVS_CHECKBOXES|#TVS_TRACKSELECT)
If OSVersion() = #PB_OS_Windows_7
AddItem(0,"C:\Users\Public\Public Pictures")
AddItem(0,"C:\Users\Public\Public Videos")
EndIf
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Quit = 1
EndSelect
Until Quit = 1
Egypt my love
Re: [Win7] ExplorerTreeGadget, Where My picture?
Why are you using that work around? LOLRASHAD wrote:Hi oryaaaaa
Code: Select all
Case #PB_Event_CloseWindow Quit = 1 EndSelect Until Quit = 1

Anyway, RASHAD - do you know how to select the whole tree subsection, when the parent is clicked?
----
R Tape loading error, 0:1
R Tape loading error, 0:1
Re: [Win7] ExplorerTreeGadget, Where My picture?
Unfortunately I am not RASHAD but perhaps you nevertheless may take a lookem_uk wrote:Anyway, RASHAD - do you know how to select the whole tree subsection, when the parent is clicked?
into my code example...

I have modified an old TreeGadget example which I had posted in the German
forum. The following example selects all subnodes that don't contain further
subnodes (tested in Windows XP SP3 x86 and Windows 7 SP1 x86):
Code: Select all
Procedure.I CheckForChildItems(ItemHandle)
Shared SelectionState
Protected TVItem.TV_ITEM
TVItem\Mask = #TVIF_CHILDREN | #TVIF_HANDLE | #TVIF_STATE
TVItem\hItem = ItemHandle
TVItem\StateMask = #TVIS_STATEIMAGEMASK
SendMessage_(GadgetID(0), #TVM_GETITEM, 0, @TVItem)
; Checkbox in front of item
; 4096 = without check mark, 8192 = with checkmark
If (TVItem\State >> 12) - 1
SelectionState = 4096
Else
SelectionState = 8192
EndIf
If TVItem\cChildren = 1
ProcedureReturn #True
Else
ProcedureReturn #False
EndIf
EndProcedure
Procedure TreeCallback(WindowHandle, Msg, wParam, lParam)
Shared SelectionState
Protected ItemHandle
Protected *NMTV.NM_TREEVIEW
Protected TVHitTest.TV_HITTESTINFO
Protected TVItem.TV_ITEM
Protected WantedSelectionState
If Msg = #WM_NOTIFY
*NMTV = lParam
If *NMTV\Hdr\hwndFrom = GadgetID(0)
If *NMTV\Hdr\Code = #NM_CLICK
TVHitTest\Pt\x = WindowMouseX(0) - GadgetX(0)
TVHitTest\Pt\y = WindowMouseY(0) - GadgetY(0)
ItemHandle = SendMessage_(GadgetID(0), #TVM_HITTEST, 0, @TVHitTest)
If ItemHandle <> 0
If TVHitTest\Flags = #TVHT_ONITEMSTATEICON
SendMessage_(GadgetID(0), #TVM_SELECTITEM, #TVGN_CARET, TVHitTest\hItem)
If CheckForChildItems(ItemHandle)
WantedSelectionState = SelectionState
SendMessage_(GadgetID(0), #TVM_EXPAND, #TVE_EXPAND, ItemHandle)
ItemHandle = SendMessage_(GadgetID(0), #TVM_GETNEXTITEM, #TVGN_CHILD, ItemHandle)
While ItemHandle <> 0
If CheckForChildItems(ItemHandle) = #False
TVItem\Mask = #TVIF_HANDLE | #TVIF_STATE
TVItem\hItem = ItemHandle
TVItem\StateMask = #TVIS_STATEIMAGEMASK
TVItem\State = WantedSelectionState
SendMessage_(GadgetID(0), #TVM_SETITEM, 0, @TVItem)
EndIf
ItemHandle = SendMessage_(GadgetID(0), #TVM_GETNEXTITEM, #TVGN_NEXT, ItemHandle)
Wend
EndIf
EndIf
EndIf
EndIf
EndIf
EndIf
ProcedureReturn #PB_ProcessPureBasicEvents
EndProcedure
OpenWindow(0, 1400, 100, 400, 400, "Select/unselect all subnodes (without subitems)", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ExplorerTreeGadget(0, 10, 10, WindowWidth(0) - 20, WindowHeight(0) - 20, #PB_Compiler_Home + "*.*")
SetWindowLongPtr_(GadgetID(0), #GWL_STYLE, GetWindowLongPtr_(GadgetID(0), #GWL_STYLE) | #TVS_CHECKBOXES)
SetWindowCallback(@TreeCallback())
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
Re: [Win7] ExplorerTreeGadget, Where My picture?
That's awesome! Exactly what I was looking for!
Thanks

Thanks

----
R Tape loading error, 0:1
R Tape loading error, 0:1