Page 2 of 6 FirstFirst 12345 ... LastLast
Results 41 to 80 of 220

Thread: [VB6] ucShellTree - Full-featured Shell Tree UserControl

  1. #41
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    261

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Fafalone,

    Your last ucShellTree upload is v2.6 uploaded 3 Apr 2021. In that package is DemoSB which I believe is a demo showing ucShellTree and ucShellBrowse working together. In Project1.vbp there is a line for the resource file as follows:

    Code:
    ResFile32="..\..\ucShellBrowse\resImagesStd.RES"
    Unfortunately there is no such file in any of the dowloaded packages at least back to ucShellBrowse 9.3. Do you still have a copy of this file around somewhere or do you have a different .RES file we should use?

    Also, the changelog.txt in ucShellBrowse hasn't been updated since version 9.4 (15 Mar 2021).

    Thanks.

  2. #42

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,647

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    You can delete that entirely. It's just the images for ucShellBrowse, which are now entirely built into the control, and I hadn't noticed the now unneeded reference in that particular demo. You can replace it with one of the current resources that come with the controls for the manifest, but there's no images or other essential data stored in resource files anymore (except to the extent a common controls 6 manifest is really kinda essential).

    changelog.txt contains changelog entries that have been pruned from ucShellBrowse.ctl. Near the top of the control source, you'll find a changelog with the more recent changes. When I remove those from the .ctl, they're moved to that .txt.

  3. #43

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,647

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Project Updated to Version 2.7

    Code:
    'v2.7 (Released 25 Jan 2022)
    '
    '-Added ShowHiddenItems/ShowSuperHidden options
    '
    '-Added EnableShellMenu option to control whether the right-click menu pops up.
    '
    '-Added SetFocusOnTree method.
    '
    '-Added public event for UserControl_EnterFocus and UserControl_ExitFocus (EnterFocus
    ' and ExitFocus, respectively).
    '
    '-(Bug fix) Keyboard focus never went to ucTreeView when on a form with ucShellBrowse.
    Also removed the dead reference in DemoSB mentioned by MountainMan above.

  4. #44
    Member
    Join Date
    Aug 2018
    Location
    nomadic within UK
    Posts
    43

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Initial feedback...

    All the focus and focus events, and keyboard navigation, now work exactly as expected, thank you.
    The issue with rapid keyboard navigation is fixed.

    Is there a method to programmatically expand/collapse the currently selected node (folder)?

    The showhidden properties work (thanks) but there are a couple of issues.....
    Can the hidden folders be shown faded just like in ucShellBrowse?
    The showhidden does not take effect till I do a "RefreshTreeView" and this is slow and disruptive, it firsts show the tree from the desktop, then shows it again with some "arbitrary" folder selected. Ideally it should just redisplay the tree as close to its previous condition as is possible (if a selected folder is now hidden move up to its parent etc)

    I also have a hidden folder $AV_AVG that appears in ucTree but not in ucShellBrowse?????? maybe its superhidden and Shellbrowse is failing to show superhiddens????

  5. #45
    Member
    Join Date
    Aug 2018
    Location
    nomadic within UK
    Posts
    43

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    note that mVersionStr is still set to 2.6 rather than 2.7

  6. #46

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,647

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Hidden and Superhidden are separate options that both default to using the Explorer value. They don't take effect on their own by design; as you note, applying options where it has to be refreshed are disruptive, so it provides the opportunity to only have to do it once after changing multiple settings.

    Not really a way around refreshing it being disruptive, though you're right I should preserve the selection. I suppose it's possible to avoid a full refresh by doing a new enumeration and just inserting or deleting the hidden items... just how slow are we talking about? Recreating the tree as close to possible is, besides the selected item part, why it takes so long as is... it's repeating each expansion action.


    With the extra hidden folder... found a bug. The high performance loader in ucShellBrowse has to convert FILE_ATTRIBUTES to SFGAO_Flags, and wasn't including FILE_ATTRIBUTES_SYSTEM. But I'm not sure why it shows in ucShellTree unless you turned on ShowSuperhidden or have that turned on in Explorer... unless maybe you mean it's in the dropdown in the browser? That's not filtered.

    There's no direct way to expand the selected node, though you could get the hWnd, get the selected node, and send TVM_EXPAND. Or navigate to a child. As for collapsing... could probably get the selected item then change the item state to remove TVIS_EXPANDED.

    Could make hidden items faded by applying the TVIS_CUT style... will do that for next version.

  7. #47
    Member
    Join Date
    Aug 2018
    Location
    nomadic within UK
    Posts
    43

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    The refresh update only takes about a second (in the compiled EXE) but as it displays the desktop first then some other folder it is very obvious. Maybe I can preserve the selection and then reselect from user code? I will investigate.

    How do I get access to the selected node? I will investigate using TVM_EXPAND.

    In the current unsupported FileTree component that I am using (and need to replace) I can do
    ucTree.selectednode.expanded = true.

    Would it be really difficult to give a "selectednode" ???
    I have written a bit of CoreAudio code but am otherwise very new to OLEexp.

  8. #48

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,647

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    There's a property hWndTreeView that returns the TV's hWnd, so you can use any TreeView API on it, including TVM_GETNEXTITEM with TVGN_CARET which gets the (first) selected node.

    Preserving the selected item with user code would be as simple as saving ucShellTree.SelectedItem then using ucShellTree.OpenToPath, which has an option to select it too.

    But I'll be adding some code with basic operations for the selected node and automatically preserving selection over the next couple days. They're simple enough if you want to copy them in now, I'll need some time to run down bugs and add some other stuff before updating the download:

    Code:
    Public Sub SelectedNodeExpand()
    Dim hNode As Long
    hNode = SendMessage(hTVD, TVM_GETNEXTITEM, TVGN_CARET, ByVal 0&)
    If hNode Then
        Call SendMessage(hTVD, TVM_EXPAND, ByVal TVE_EXPAND, ByVal hNode)
    End If
    End Sub
    Public Sub SelectedNodeCollapse()
    Dim hNode As Long
    hNode = SendMessage(hTVD, TVM_GETNEXTITEM, TVGN_CARET, ByVal 0&)
    If hNode Then
        Call SendMessage(hTVD, TVM_EXPAND, ByVal TVE_COLLAPSE, ByVal hNode)
    End If
    End Sub
    Public Sub SelectedNodeToggle()
    Dim hNode As Long
    hNode = SendMessage(hTVD, TVM_GETNEXTITEM, TVGN_CARET, ByVal 0&)
    If hNode Then
        Call SendMessage(hTVD, TVM_EXPAND, ByVal TVE_TOGGLE, ByVal hNode)
    End If
    End Sub
    
    Public Sub SelectedNodesExpand()
    Dim hItemSel As Long
    Do
        hItemSel = SendMessage(hWnd, TVM_GETNEXTITEM, TVGN_NEXTSELECTED, ByVal hItemSel)
        If hItemSel Then
            Call SendMessage(hTVD, TVM_EXPAND, ByVal TVE_EXPAND, ByVal hItemSel)
        End If
    Loop While hItemSel
    End Sub
    Public Sub SelectedNodesCollapse()
    Dim hItemSel As Long
    Do
        hItemSel = SendMessage(hWnd, TVM_GETNEXTITEM, TVGN_NEXTSELECTED, ByVal hItemSel)
        If hItemSel Then
            Call SendMessage(hTVD, TVM_EXPAND, ByVal TVE_COLLAPSE, ByVal hItemSel)
        End If
    Loop While hItemSel
    End Sub
    Public Sub SelectedNodesToggle()
    Dim hItemSel As Long
    Do
        hItemSel = SendMessage(hWnd, TVM_GETNEXTITEM, TVGN_NEXTSELECTED, ByVal hItemSel)
        If hItemSel Then
            Call SendMessage(hTVD, TVM_EXPAND, ByVal TVE_TOGGLE, ByVal hItemSel)
        End If
    Loop While hItemSel
    End Sub
    Public Sub CheckedItemsExpand()
    Dim i As Long
    For i = 0 To UBound(TVEntries)
        If (TVEntries(i).Checked = True) And (TVEntries(i).bDeleted = False) Then
            SendMessage hTVD, TVM_EXPAND, TVE_EXPAND, ByVal TVEntries(i).hNode
        End If
    Next i
    End Sub
    Public Sub CheckedItemsCollapse()
    Dim i As Long
    For i = 0 To UBound(TVEntries)
        If (TVEntries(i).Checked = True) And (TVEntries(i).bDeleted = False) Then
            SendMessage hTVD, TVM_EXPAND, TVE_COLLAPSE, ByVal TVEntries(i).hNode
        End If
    Next i
    End Sub
    Public Sub CheckedItemsToggle()
    Dim i As Long
    For i = 0 To UBound(TVEntries)
        If (TVEntries(i).Checked = True) And (TVEntries(i).bDeleted = False) Then
            SendMessage hTVD, TVM_EXPAND, TVE_TOGGLE, ByVal TVEntries(i).hNode
        End If
    Next i
    End Sub
    (SelectedNodes____ is for if MultiSelect is enabled)

    As for preserving selection I didn't test it yet but modifying RefreshTreeView like this should work:
    Code:
    Public Sub RefreshTreeView()
    'Resets to the root then expands all the previous locations
    'The lengthy code involves minimizing the OpenToPath calls by calculating
    'smallest group of folders that will give us the same setup. E.g.:
    'C:\a\b\(c,d,e,f) will call only C:\a\b\c, and not d,e,f or C:\a or b, because
    'expanding to c will give us a b d e and f too
    Dim i As Long
    Dim sData() As String
    
    If CalcRefreshData(sData) Then
        ResetTreeView
        
        For i = 0 To UBound(sData)
            OpenToPath sData(i), False
        Next i
    End If
    OpenToPath sSelectedItem, False, True
    Exit Sub
    e0:
        DebugAppend "PruneParentsFromRPL.Error->" & Err.Description & "(0x" & Hex$(Err.Number) & ")"
    
    End Sub
    Last edited by fafalone; Jan 26th, 2022 at 07:52 PM.

  9. #49
    Member
    Join Date
    Aug 2018
    Location
    nomadic within UK
    Posts
    43

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    A small cosmetic issue....
    On my win10 PC:
    in ShellBrowse the highlight bar (currently selected item) is quite a dark blue with white text, which is good.
    In ShellTree its also blue but the text remains black which is less easy read, can it be white?

  10. #50

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,647

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    That's the default behavior of the controls, not something I've set. But, I can give ucShellTree a CustomColor event like ucShellBrowse and start providing the item state values to them. I don't want to override the defaults but can provide customization.

    It also appears to be an issue only present without ComCtl6. With them, it stays black but the lighter blue makes it easier to read. Really advisable to manifest the IDE and your apps.

  11. #51
    Member
    Join Date
    Aug 2018
    Location
    nomadic within UK
    Posts
    43

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    I am pretty sure that I am including the manifest, but I will check and confirm.

  12. #52

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,647

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Press Ctrl+Shift+P in the ucShellBrowse listview, that shows an About box that includes whether ComCtl6 is enabled.

  13. #53
    Member
    Join Date
    Aug 2018
    Location
    nomadic within UK
    Posts
    43

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    That About Box is a really useful feature, thanks.
    I am using the CC6 manifest (and use it in almost all of the software that I write) but did compile my test program without it to try to find a bug, and also out of curiosity/self education.
    usShellBrowse and Tree both work well for me without the manifest. The only things I have observed are:
    Different Icons (which I quite like)
    Different Font (I don't really understand this, is it a DPI related thing?)
    The order of items in This PC are different and not as good (in ucShellBrowse)
    The command buttons don't get the satisfying blue highlight on mousemove.
    However I suspect there are some things that go badly wrong.

  14. #54
    Member
    Join Date
    Aug 2018
    Location
    nomadic within UK
    Posts
    43

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Concerning expanding and collapsing the treeView nodes programmatically...
    Sending the TVM_Expand message works very well and its really easy to get the handle of the currently selected node by just monitoring hitem in ShellTree.ItemSelect.
    But it will still be good to have this functionality built in.
    Thanks.

  15. #55
    Member
    Join Date
    Aug 2018
    Location
    nomadic within UK
    Posts
    43

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Oops, apologies, I was over confident with my quick testing.
    It is only possible to expand a node with a message if that node has been previously expanded by a proper click on its expando. I assume that you build the tree on demand so only you can expand it?, interacting directly with the tree using messages will not get any file system detail????

  16. #56

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,647

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    It should... it expands the folder in response to a TVN_ITEMEXPANDING notification; I'd think the API would send that? Are you changing the item state or using TVM_EXPAND? MSDN says it raises the message for the latter, but I'm not clear if the former would.

    It also notes that if you expanded it once, a subsequent message wouldn't send the notification again... so if you tried to expand it, then list files copied after that into that folder, it wouldn't attempt to load them unless you cleared the TVIS_EXPANDEDONCE flag on the item:

    When an item is first expanded by a TVM_EXPAND message, the action generates TVN_ITEMEXPANDING and TVN_ITEMEXPANDED notification codes and the item's TVIS_EXPANDEDONCE state flag is set. As long as this state flag remains set, subsequent TVM_EXPAND messages do not generate TVN_ITEMEXPANDING or TVN_ITEMEXPANDED notifications. To reset the TVIS_EXPANDEDONCE state flag, you must send a TVM_EXPAND message with the TVE_COLLAPSE and TVE_COLLAPSERESET flags set. Attempting to explicitly set TVIS_EXPANDEDONCE will result in unpredictable behavior.
    Is it generating an ItemExpand event? Also, what's the return code? The control does reject that message under some circumstances; I had put a flag to work around a certain bug, but hadn't considered the case of manipulating it externally through API. If TVM_EXPAND is returning 1, that's the problem.
    Last edited by fafalone; Feb 1st, 2022 at 06:36 PM.

  17. #57
    Member
    Join Date
    Aug 2018
    Location
    nomadic within UK
    Posts
    43

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    I'm doing this with sendmessage:

    h = ucTree.hWndTreeView
    response = SendMessage(h, TVM_EXPAND, TVE_EXPAND, ByVal hNode)
    where hnode is a copy of the most recent hitem.

    It returns 0 and nothing happens, but once I have expanded the node by a click on the expando (which fires itemexpand) then it works and returns 1, but still does Not fire itemexpand.

    Is it possible to do API calls to the TreeView?, I can't find anything about it on the www. I half remember doing some API calls to a TreeView many years ago and getting big problems.

  18. #58

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,647

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    What do you mean? SendMessage is sending API calls to the TreeView. It's not a VB TreeView, it's a pure API one created with CreateWindowEx. Everything inside the control is done via listening for and sending API messages.

    In fact if you look at the TVNavigate routine that expands out to an item, you'll see it's using TVM_EXPAND messages.

    I'm not sure why it's ignoring that message, I'll look into it tonight.
    Last edited by fafalone; Feb 2nd, 2022 at 06:52 PM.

  19. #59
    Member
    Join Date
    Aug 2018
    Location
    nomadic within UK
    Posts
    43

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Sorry, my bad terminology I think.
    Sendmessage is an API call but its a sort of generic one that can send messages to any window.
    I thought it might be also possible to make calls to the TreeView DLL directly (I assume TreeView is a DLL somewhere?), but maybe I am wrong as can't find any info on this.
    Note that I try to use VB as a high level language and although I have had to do a lot of API things I really am not expert at this.

  20. #60

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,647

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    It's in Comctl32.dll but that I'm not sure what could be gained.

    There's no problem expanding the node for me, both with the function I'm adding and using SendMessage .hWndTreeView and the hItem from ItemSelect from the host form. Do you have Multiselect = True? In that scenario, the TVN_SELCHANGED message isn't raised by a click, so the correct hItem wouldn't be set if you're getting them from watching ItemSelect. You'd want to look at the ItemClick event in that case probably. Also checking an item wouldn't raise that message either.

    You could ask it for the selected node yourself too,
    hNodeSelected = SendMessage(hTVD, TVM_GETNEXTITEM, TVGN_CARET, ByVal 0&)


    Here's the node functions I'm planning for the next version:
    Code:
    Public Sub SelectedNodeExpand()
    Dim hNode As Long
    hNode = SendMessage(hTVD, TVM_GETNEXTITEM, TVGN_CARET, ByVal 0&)
    If hNode Then
        Call SendMessage(hTVD, TVM_EXPAND, ByVal TVE_EXPAND, ByVal hNode)
    End If
    End Sub
    Public Sub SelectedNodeCollapse()
    Dim hNode As Long
    hNode = SendMessage(hTVD, TVM_GETNEXTITEM, TVGN_CARET, ByVal 0&)
    If hNode Then
        Call SendMessage(hTVD, TVM_EXPAND, ByVal TVE_COLLAPSE, ByVal hNode)
    End If
    End Sub
    Public Sub SelectedNodeToggle()
    Dim hNode As Long
    hNode = SendMessage(hTVD, TVM_GETNEXTITEM, TVGN_CARET, ByVal 0&)
    If hNode Then
        Call SendMessage(hTVD, TVM_EXPAND, ByVal TVE_TOGGLE, ByVal hNode)
    End If
    End Sub
    
    Public Sub SelectedNodesExpand()
    Dim hItemSel As Long
    Do
        hItemSel = SendMessage(hWnd, TVM_GETNEXTITEM, TVGN_NEXTSELECTED, ByVal hItemSel)
        If hItemSel Then
            Call SendMessage(hTVD, TVM_EXPAND, ByVal TVE_EXPAND, ByVal hItemSel)
        End If
    Loop While hItemSel
    End Sub
    Public Sub SelectedNodesCollapse()
    Dim hItemSel As Long
    Do
        hItemSel = SendMessage(hWnd, TVM_GETNEXTITEM, TVGN_NEXTSELECTED, ByVal hItemSel)
        If hItemSel Then
            Call SendMessage(hTVD, TVM_EXPAND, ByVal TVE_COLLAPSE, ByVal hItemSel)
        End If
    Loop While hItemSel
    End Sub
    Public Sub SelectedNodesToggle()
    Dim hItemSel As Long
    Do
        hItemSel = SendMessage(hWnd, TVM_GETNEXTITEM, TVGN_NEXTSELECTED, ByVal hItemSel)
        If hItemSel Then
            Call SendMessage(hTVD, TVM_EXPAND, ByVal TVE_TOGGLE, ByVal hItemSel)
        End If
    Loop While hItemSel
    End Sub

  21. #61
    Member
    Join Date
    Aug 2018
    Location
    nomadic within UK
    Posts
    43

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Its very odd.
    I do not have Multiselect enabled.

    I have just put my SendMessage test button and code into your ShellTreeDemo and it works ok there, so it must be a property or something in my test app that is the issue. I will investigate. I am a bit busy tomorrow so it might take an extra day to do this.

  22. #62
    Member
    Join Date
    Aug 2018
    Location
    nomadic within UK
    Posts
    43

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Sorted, sort of.
    I had SingleClickExpand set True and this is the cause of my problem.
    This was my mistake as I did not read your property description and so misunderstood what this property does.
    However it does not appear to do what it says...I can still expand multiple parts of the tree even when it is set to true???

  23. #63

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,647

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Ok, I found the issue.

    SingleClickExpand is False by default, which it triggering code that blocks the expand. (Please turn on dbg_PrintToImmediate, it logs exactly what happened I don't have the print to file functionality to log in the exe in it though... will add next version.)

    The whole functionality around that setting is a mystery I can't recall... since it doesn't expand in a single click if that setting is True anyway. But it's obviously a bug fix code that was stopping unwanted expansions. So I don't recall what was happening, will have to look into it. For now, since SingleClickExpand doesn't do anything (at least with a manifest, didn't check without cc6), it's ok to turn it on. (Or does it? Didn't check Win7 maybe that's it.)
    Last edited by fafalone; Feb 3rd, 2022 at 04:04 PM.

  24. #64
    Member
    Join Date
    Aug 2018
    Location
    nomadic within UK
    Posts
    43

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    ok, away now, should be able to find some time late tomorrow.
    We are putting a lot of nitty gritty test detail into this thread, is that ok? or should we do this detail by email and only post the conclusions?

  25. #65
    Member
    Join Date
    Aug 2018
    Location
    nomadic within UK
    Posts
    43

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    I was going too fast yesterday and trying to do several things at once (and failing).
    As you say SingleClickExpand needs to be True (not False) for the SendMessage to work, and it does not do anything else and does not implement a single click expand which might well be an undesirable feature, so all is well.
    Also I had confused this with SingleExpand which allows only one node to be expanded, but this also appears not to work and is probably also not a useful feature so not worth investigating???
    Maybe these were both options that Microsoft thought about implementing then decided best not to?????

  26. #66

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,647

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Oh weird...

    If I turn on SingleExpand, SingleClickExpand works when enabled, and then SingleExpand works as advertised; clicking on an item in same level expands that one and collapses the other. But only if you click the item name, using the expando buttons will open multiple. All that code I have in item click and expand revolving around this no doubt relates to this somehow... I'm really going to have to do a review of how these options behave and interact with/without ComCtl6 and Win7 vs Win10.

    But for now be advised I was incorrect; if both of those options are True, it will change the behavior and do as the option names indicate.


    It's fine to keep posting in the thread if you want to; others could be encountering similar issues, or related issues in the future where some of the info posted is helpful. Like knowing they're not going crazy when those two options don't work one at a time, but do together.

  27. #67
    Member
    Join Date
    Aug 2018
    Location
    nomadic within UK
    Posts
    43

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    You know much more than me, but I suspect that there are many weird, random and undocumented behaviours is these parts of Windows.
    Maybe this is why LogicNP withdrew from this business? though I suspect issues with Win10 updates breaking their software was also an issue.
    I think you are now the only one with viable ShellBrowsing components for COM (plus maybe Exontrol but theirs have a lot of limitations).
    Maybe just need to concentrate on the core functionality for now and note that some of the more obscure features are "not currently supported"??. This is what Microsoft themselves do??

  28. #68
    Member
    Join Date
    Aug 2018
    Location
    nomadic within UK
    Posts
    43

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Is it easy/viable to display Win10 style "Quicklinks" in the ucTree?

    How can I set the initialpath to "ThisPC" ?

    How can I set the Browserpath in ShellBrowse (and hence the linked ucTree) to either ThisPC or Desktop?

    In my file dialogs I try to set the path to that used in the most recent load/save operation and persist this, but need to default to either Desktop or ThisPC if that path is no longer valid.
    The LogicNP controls have a "ResettoDesktop" method, but defaulting to ThisPC might be a nicer option.

  29. #69

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,647

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    As the initial path or as the root?

    There's an option ComputerAsRoot to make it the root (same on ucShellBrowse for the dropdown).

    For other places you enter a path, or to do this manually, and for other special locations without normal paths, it's done by using the GUID that identifies it.

    ThisPC is ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}. If you Google that, you'll find it on lists with other locations.

    Since it's asking the Windows shell, you can use whatever the shell accepts... enter the above in the Run... command or the Explorer address bar, and you'll find you're also taken to This PC.


    --
    I'm inclined to leave all options available, since you never know what OS it's being used on... a lot of people run 7 still (and honestly I'm fed up with 10 to the point I'm going to sell my brand new hardware if my next attempt to make 7 boot on it fails too). But I have been adding options that restrict things from being available during if the user wants... like that Content view on ucShellBrowse is a mess, I thought I had it off by default but I guess I left it on. So I had a UserOption flag, then eventually added a Property where any view could be restricted. I will try to make sure the default settings are stable across all Windows versions.
    Last edited by fafalone; Feb 6th, 2022 at 01:32 AM.

  30. #70
    Member
    Join Date
    Aug 2018
    Location
    nomadic within UK
    Posts
    43

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Thanks
    Just after posting above I had a try at browsing to the "ThisPC" GUID and it works fine.

    I'm committed to Windows10 (and I suppose soon 11). I held out with both 98 (my favourite) and XP for a long time but have now accepted that its just too difficult fighting against Microsoft. I like a lot of Win10, my only big concern is the frequent automatic updates and the real possibility that one will break my software which is all in VB6. One update did break things but it was the LogicNP shellbrowser that was to blame, and that's written in C++.
    This is partly why I am keen to use your Shell Browser, the source code is available so if an update does break it then there is at least a chance that it might get fixed, even if you don't want to do it yourself.

  31. #71

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,647

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    There's now a Beta release of a 64bit-compatible version of this control for twinBASIC. Requires tB Beta 207 or newer.

    More info, download, and browse source on GitHub.

    ucShellBrowse will take a bit longer, it's much more complex and impacted severely enough by current limitations of tB UserControl support that it doesn't run properly yet. Hopefully soon

  32. #72
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    445

    Question ItemCheck event not triggered

    VB6SP6
    Win10x64

    Im testing your ucShellTree v2.7 control and i found 2 bugs:

    ItemCheck bug:

    I want to uncheck a user-checked folder item in the event ItemCheck but this event is never triggered when i click on a checkbox.

    Tri-State Bug:

    The control .Checkboxes property is set to false. After i set .Checkboxes = True in the form_load the control switches through all 3 states (Check, Partial, uncheck) when im clicking on the checkbox. This doesnt happen when the control .Checkboxes property is True and not set by code.
    Last edited by Mith; Jan 27th, 2024 at 02:36 AM.

  33. #73

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,647

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    The checkbox should only be set to partial by the autocheck feature... can you describe how to reproduce this? (If it is set in this manner; it's cosmetic only, there's no current option to enable autocheck but not have cosmetic partial checks).

    You can disable AutoCheck but I can't remember if I handled path reporting 100% correct for that.

    (Verify that ExclusionChecks is False, if it's True that adds a 3rd user-selectable check)

  34. #74
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    445

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    control property values:

    Code:
    Autocheck=false
    Checkboxes=false
    ExclusionChecks=false
    Form_load:

    Code:
    ucTree.Checkboxes = True

    Clicking on a checkbox switches between "Check, Partial & Uncheck"...

  35. #75
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    445

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    i found another bug:

    auto check of sub items works not correct.

    1. I check a folder and after that i expand the folder. Now all sub items are checked (folders AND files).
    2. I expand a folder and now i check the folder. No sub items are checked.

    control property values:

    Code:
    Autocheck=false
    Checkboxes=TRUE
    ExclusionChecks=false
    ShowFiles=TRUE
    BTW: How to select single folders without the auto check of all sub items?

  36. #76
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    445

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Quote Originally Posted by Mith View Post
    i found another bug:

    auto check of sub items works not correct.

    BTW: How to select single folders without the auto check of all sub items?
    U can fix the AutoCheck-bug in the Sub "TVExpandFolder":

    Before:
    Code:
                        If bFav Then
                            TreeView_SetCheckStateEx hTVD, hitemPrev, 0
                        Else
                            If TreeView_GetCheckState(hTVD, hitemParent) = 2 Then
                                TreeView_SetCheckState hTVD, hitemPrev, 1
                            End If
                        End If
    Fixed:
    Code:
                        If bFav Then
                            TreeView_SetCheckStateEx hTVD, hitemPrev, 0
                        Else
                            If TreeView_GetCheckState(hTVD, hitemParent) = 2 Then
                               If mAutocheck = True Then
                                 TreeView_SetCheckState hTVD, hitemPrev, 1
                                End If
                            End If
                        End If

  37. #77

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,647

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Thanks, will include that fix in next release and credit you for it.

    Sorry if I'm having a little trouble following, it seems like that should resolve all issues here? Or was there still an issue? (Checking all items when expanding a checked folder when autocheck = true is by design; the parent being checked implies the children are checked. If you uncheck a child after that, the parent should change to partially checked).

  38. #78
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    445

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Quote Originally Posted by fafalone View Post
    Sorry if I'm having a little trouble following, it seems like that should resolve all issues here?
    No. The Tri-State-bug is still alive. See my posting https://www.vbforums.com/showthread....=1#post5630320 to reproduce it.

    Quote Originally Posted by fafalone View Post
    (Checking all items when expanding a checked folder when autocheck = true is by design; the parent being checked implies the children are checked. If you uncheck a child after that, the parent should change to partially checked).
    BUT Autocheck is set to FALSE! See Post https://www.vbforums.com/showthread....=1#post5630321

  39. #79
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    445

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    The only workaround for the Tri-State-bug is currently to set checkboxes=true at the control properties and not in the code.

  40. #80

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,647

    Re: [VB6] ucShellTree - Full-featured Shell Tree UserControl

    Hmm, definitely odd behavior and I'll need to study it more in depth. As a temporary solution, this should override it by detecting the switch into partial when Autocheck = False, then advancing it to cleared. This won't work if ExclusionChecks = True.

    In ShellTreeSubclassProc, go to the handler for TVM_ITEMCHANGEDW, change:

    Code:
                    ElseIf ((nmtvic.uStateNew And TVIS_STATEIMAGEMASK) = &H3000) And (mAutocheck = False) Then
                        DebugAppend "ItemExclude"
                        TVEntries(nmtvic.lParam).Checked = False
                        TVEntries(nmtvic.lParam).Excluded = True
    to

    Code:
                    ElseIf ((nmtvic.uStateNew And TVIS_STATEIMAGEMASK) = &H3000) And (mAutocheck = False) Then
                        DebugAppend "ItemExclude"
                        If mExCheckboxes Then
                            TVEntries(nmtvic.lParam).Checked = False
                            TVEntries(nmtvic.lParam).Excluded = True
                        Else
                            SetTVItemStateImage nmtvic.hItem, tvcsEmpty
                        End If

Page 2 of 6 FirstFirst 12345 ... LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width