Page 4 of 4 FirstFirst 1234
Results 121 to 129 of 129

Thread: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive features

  1. #121

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    2,583

    Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature

    Project Updated to Version 8.4

    I noticed a lot of room for improvement when looking at the sorting in the previous version. First, a major bug had gone unnoticed: Sorting by default columns (size, type, and date created/accessed/modified) did not work at all in Libraries and some other special folders.
    Decided to entirely overhaul the sorting system after that. See the changelog below for details, but the important takeaway is that bug is fixed, extended columns with formatted numbers and dates are now sorted correctly as they're no longer treated as plain strings, and the new method dramatically boosts performance. Sorting large folders is now up to a whopping 600% faster, and this applies to all columns, default and extended. Also items inserted after the folder is loaded had a number of sort issues corrected.

    Code:
    'New in v8.4 (Released 17 Sep 2020)
    '
    '-The sorting methods have been completely overhauled. All sorting is now done
    ' via built-in algorithms unless disabled. Specifically:
    '
    '    -Sorting performance for all columns has been dramatically improved. All of the
    '     column data is now cached in the main information structure for each item when
    '     the folder is first loaded, eliminating several API calls to find the item in
    '     the list then read the text from the column display.
    '     This improved sorting speed by 200-600% in tests; the more items, the bigger
    '     the improvement. Sorting 3,000 items went from 950ms to 170ms.
    '
    '   -(Bug fix) Sorting by default columns was broken in Libraries and some other
    '       special folders. IShellFolder.CompareIDs, which was being used, is
    '       now being disabled entirely unless you set AlwaysSortWithISF to True.
    '       Otherwise, the new routine for extended columns is used on all of the
    '       columns. This performs 200-500% better.
    '
    '   -(Bug fix) All extended columns were treated as strings by the sort algorithm.
    '       This resulted in numbers that were formatted to partial text not
    '       sorted- such as the Free Space column in This PC, which is displayed
    '       as e.g. 502 GB. This would just be treated as a plain 502, which
    '       might be smaller than 1.0 TB, which would be 1.
    '       The new system records the raw number before formatting (in our
    '       example, the value in bytes), and uses that in the sort algo.
    '
    '    -(Bug fix) For extended columns sorted by text, the ascending/descending arrow
    '       in the column header didn't match whether the column was currently
    '       sorted that way (it indicated the opposite).
    '
    '    -(Bug fix) There were some issues with how items added after the folder loaded
    '       were sorted.
    '
    '-Added user option bScrollToSelectedAfterSort.
    '
    '-The StatusText property appeared in the design-time Properties window, but
    ' setting it there neither showed the message or saved it. That property has
    ' now been hidden from the Properties window- you can of course still read and
    ' write it during runtime. In its place is a new StatusTextStart property, that
    ' will display a message in the Status Bar when the control first loads.

  2. #122

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    2,583

    Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature

    Project Update: Version 8.4 R2
    High-priority Bug Fixes

    The right-click shell context menu was not returning the correct command ids for numerous items, making it take a different action than the menu item indicates. This affects 3rd party additions to the menu, and a couple non-default built in options, but not Properties/Copy/Cut/Rename/Delete. By playing around with the options, this bug seems to have been corrected, but if you encounter any situation where the menu item and action don't match, please let me know.
    This fix also results in a number of icons for 3rd party entries showing where they weren't before, and the Send To submenu having significantly more options, also showing icons that were missing.
    Further, made the extended verbs like 'Open command window here' an option: AlwaysShowExtendedVerbs. If False, they are only shown when the Shift key is pressed when the click occurs, which is how it works in Explorer.

    Additionally, almost none of the UUID variables were explicitly typed (they were all As UUID instead of As oleexp.UUID). This results in a situation where the program won't run if there's a Public Type UUID anywhere in the project, or another TLB that's a higher priority than oleexp. While it's uncommon and trivial to fix, this is something that should have been fixed a long time ago. While I was at it, I went ahead and eliminated all non-explicit types defined in the TLB, so there's no further possibility on conflicts.
    Note: There's also an update to ucShellTree with this same bug fix for that project.

    Also added a Copy Path menu entry.

    (Note: The project was re-uploaded on the 22nd, but that was just to turn off printing debug info to the Immediate window; set dbg_PrintToImmediate to False, and making the menu tip for the Browse shell context menu item appear in the status bar, so I didn't update the version since it's simple enough to toggle that yourself)

    Code:
    'New in v8.4 R2 (Released 19 Sep 2020)
    '
    '-Added a 'Copy path' item to the View menu, which copies the full path of the
    ' current location to the clipboard. Can be disabled with bDisableCopyPathMenuItem
    ' User Option. Copies the parsing path, so ::{GUID} paths for virtual locations.
    '
    '-Added option AlwaysShowExtendedVerbs for the Shell Context Menu. If set to False,
    ' certain extended verbs like 'Open command window here' will only appear on the
    ' Shell Context Menu (right-clicking on an item) when Shift is pressed, which is
    ' how it works in Explorer.
    '
    '-(Bug fix) A large number of commands in the Shell Context menu (displayed when
    '           right clicking an item) did not execute the right command. This is a
    '           very strange bug, as there's no reason it should be reporting the wrong
    '           item ID. I've found a fix that seems to have largely eliminated this
    '           issue, but please let me know if it pops up with your extensions.
    '           This change also allows some 3rd party shell extension icons to appear
    '           which were previously not loading, and has additional items on the
    '           Send To submenu, which now also shows previously missing icons.
    '
    '-(Bug fix) Most instances of UUID variables were not explicitly typed (they were
    '           'As UUID' instead of 'As oleexp.UUID'). The result is show stopping
    '           errors if anywhere in the project there was a Public Type UUID.
    '           Additionally, I've gone ahead and replaced *all* non-explicit types
    '           that were defined in oleexp, to eliminate any possible conflicts.
    '
    '-(Bug fix) The menu tip for the 'Browse' command on the shell context menu had
    '           not been added.

  3. #123

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    2,583

    Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature

    Version 8.5 Beta


    The upcoming version has 2 complex new features (and a few smaller ones), and a ton of bug fixes, so I'm posting it as a Beta here first; both because the bug fixes are numerous and a few very important, and to see if anyone runs across an issue with the new features.

    First, it's now possible to fully replicate the VB DirListBox. Previously, if you wanted a parent tree, you had to use the separate dropdown. I've added a new feature that, in Details Mode without groups, you can have a parent tree right in the list with the ShowParentTreeInList option:
    Name:  sbasdb.jpg
Views: 108
Size:  32.3 KB
    There's a new demo, DemoVBDir, that shows how to configure the control to get the above appearance (ShowParentTreeInList, ControlType=FilesOnly, DefaultColumns blank and LockColumns=SBCL_LockNoAuto so only the name column is present and no new ones load, HideColumnHeader, FoldersOnly, ViewMode = SB_VIEW_DETAILS).
    A key improvement over the VB version is that when you navigate to the root drive, it will load the rest of Computer so you're able to get to other drives with just the one control.

    The other big feature is now the Columns popup reflects the actual order of the columns, and you can configure the order right there in the popup:
    Name:  sbcolorder.jpg
Views: 104
Size:  39.8 KB


    Here's a full list of changes:
    Code:
    'New in v8.5 (Beta Release: 12 October 2020)
    '
    '  Beta Rolling Changes 
    '(14 Oct 5:50PM)
    '   -Previously, Directory Only modes followed the standard loading procedure of not
    '    adding items under the dropdown unless they were opened. Now, if the mode is
    '    Directory Only or Directory Only With Controls, selecting a folder will add the
    '    child folders under it.
    '
    '   -(Bug fix) GetValue calls were set as functions when the last release of oleexp
    '              expected a sub.
    '
    '(13 Oct 12:37A):
    '
    '   -Added SelectColumnOnSort to highlight a column when you sort by it.
    '
    '   -The color of the highlight can be set with the new ColumnSelectColor option.
    '
    '   -(Bug fix) The 'Advanced Mode' option was missing from the Column Select dropdown
    '           menu under the Property header.
    '
    'First beta post:
    '-The new ShowParentTreeInList option will, in Details View only (and only if Group
    ' View is disabled), turn the file list into a view similar to a TreeView-- or, the
    ' VB DirListBox. The first item will be the drive root, then each parent below it
    ' indented slightly more, until the current folder, where all items are then listed
    ' at the same level, e.g. :
    ' C:\
    '   vb6
    '     ucShellBrowse
    '       Demo
    '       Demo2
    '       Demo3
    ' and so on. The folders always appear at the top, then the current folder contents
    ' are sorted in their normal order, and this is preserved as you change the sort
    ' column and direction.
    ' The tree, by design, only go to Computer, if the Desktop is root, or the current
    ' drive, if Computer is root. Custom roots will go all the way to the root.
    ' There's also a User Option, bShowParentItemsInAllViews, to add these items to
    ' other views, but they will not be visually distinguished from items in the same
    ' location, so this is disabled by default.
    '
    '-The Column Select popup now reflects the current order of columns, and there's
    ' a new UpDown control that lets you change the order of the columns in the popup,
    ' and the ListView also supports dragging and dropping items to their location; an
    ' insertion mark is displayed between the items you're dropping it in between.
    ' Note that the new order won't be applied until the dialog is closed.
    '
    '-There's now a MinHeightDropdown option. Previously, it was hard coded to just
    ' always be 300 * scale no matter what.
    '
    '-That option pairs with the DropdownFixedHeight option. If this option is set to
    ' zero, the dropdown height is set to the UserControl height. Otherwise, it's set
    ' to the value specified (*scale), or the MinHeightDropdown, whichever is larger.
    ' Note: This cannot be changed at runtime.
    '
    '-Added SpecialFoldersInBookmarks to control whether the submenu full of special
    ' folders like Downloads, Windows, Documents, etc, shows in the Bookmarks Menu;
    ' previously there wasn't even a UserOption for this.
    '
    '-The Bookmarks menu no longer has 'Clear all bookmarks' enabled if no bookmarks
    ' have been created.
    '
    '-(Bug fix) If starting blank and in Details View, some properties were listed in
    '           the Column Select Popup that should be hidden (System.*).
    '           Why that's the case and being unable to fix it takes the cake for the
    '           single most bizarre behavior I've ever seen, but I found a workaround.
    '
    '-(Bug fix) If you specify a custom root, and lock it, the control loads the root
    '           path instead of the initial path in BrowserPath. Additionally, if you
    '           specified a BrowserPath during design time for the initial path, this
    '           resulted in various glitches and improperly adding it to the tree.
    '
    '-(Bug fix) If you specify a custom root, and lock it, attempting to navigate to
    '           a location that's not a child of the root, such as though bookmarks,
    '           special folders, or shortcuts, the path won't load, however, it will
    '           still be added to the dropdown under the root (Root\Computer\path).
    '           Selecting it from the dropdown still wouldn't load the path, but the
    '           item should never be added to the dropdown.
    '
    '-(Bug fix) The preference for Super Hidden items wasn't applied for items added
    '           after the folder is already loaded (in LVAddEntry).
    '
    '-(Bug fix) If you navigated directly from a Search Results folder to a Custom
    '           Folder, the Search Footer would not be removed.
    '
    '-(Bug fix) If you specify a custom root and lock it, Search will not work,
    '           because the Results Folder would not be recognized as a valid child
    '           of the path, since as a virtual object it had no path to compare.
    '           Added manual check and override for both the initial action and
    '           navigating away then re-selecting the results from the dropdown.
    '
    '-(Bug fix) With the above fix, this would have normally also loaded the Search
    '           Footer, which would have the 'Search Again' options. The Search
    '           Footer has been preemptively disabled to prevent loading items
    '           outside the given root, until a method is added to ensure all the
    '           locations are valid children of the root.
    '
    '-(Bug fix) In many circumstances when you sorted, then navigated to a different
    '           location, the sort column wouldn't be cleared, the new location would
    '           by sorted by that column except always processed as text, and the sort
    '           arrow and column highlight wouldn't reset.
    I'll be testing it myself over the next few days, but it seems pretty solid so definitely give it a go if any of these changes are important for you!

    NOTE: Main post on Page #1 is where the beta is posted now; needed to address some bugs in the old version ASAP.

  4. #124
    Fanatic Member
    Join Date
    Jul 2007
    Location
    Essex, UK.
    Posts
    512

    Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature

    I can't get past any of the

    Code:
    hr = pps.GetValue(uColData(lp).pKey, vrw)
    calls. Getvalue is highlighted and all its intellisense works fine. I can see all the members. Oleexp 4.62 is referenced and loaded. If I rem out this one then the next one in the next function will error. HELP!!

  5. #125

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    2,583

    Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature

    Fixed.

    I thought I had the current oleexp version in my system folder but apparently I had the wrong one, on both my main computer and the win10 laptop I use for testing. It's declared as a Sub in 4.62 so using it as a function there was causing an error.

    You can grab the new version or just change it to pps.GetValue uColData(lp).pKey, vrw in the 3 places it occurs.

    What's weird is nobody let me know before now and this same issue is present in the main version

    ---
    Also made a major change to Directory Only (and DirOnly w/Ctls); previously, it wouldn't add children to the dropdown when you selected a folder, limiting it to only what's initially loaded if you didn't have it joined with a ListView that showed them. Now, it will expand the selected directory in the dropdown.
    Note: For now, folders added under this rule will appear in reverse alphabetical order, while I work on a way to get them in the right order since everything I've tried so far results in breaking parent/child ordering when higher level folders are loaded.

  6. #126
    Fanatic Member
    Join Date
    Jul 2007
    Location
    Essex, UK.
    Posts
    512

    Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature

    Works fine now Jon, thank you. However, it is still very slow showing the contents of my Music folder (currently 58992 tracks). Is this not the right tool for that job? Am I expecting too much?

    Explorer < 1 sec.
    ucShellBrowse<> 25 secs.

  7. #127

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    2,583

    Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature

    Presumably, Explorer recognizes it as a music folder, therefore loads columns that read title and album from the ID3 tags.

    I believe the difference is Explorer is reading them on demand as they come into view, as opposed to my control, which will read the data for all files on load. Should make the initial scroll through more responsive, but obviously takes time.

    Long term Im planning on rewriting things to do things the Explorer way, but it's complete overhaul.

    If you don't need the columns that read the ID3 tags, you can turn off the feature that detects the default column set by setting LockColumns to LockNoAuto (you can load them later through the column select), but if you do want those, right now yeah it's going to be slow to open and read 50k files at once.

    UPDATE:
    So I was able to implement a limited version of the way Explorer only reads data on demand.

    I'm posting an experimental version of the control here that sets callbacks for every column besides Name and Size; this way ID3 tag properties and everything else is not loaded until the first time the file comes into view. As is the case in Explorer, there will be delays the first time you scroll an item into view, but the initial load is *much* faster.

    To compare against the old behavior, you can set ExtendedColumnPreload to True to go back to loading everything first.

    All the basics are working; Details View and Tile View, adding new columns, but there's a lot to validate before making it the main release.
    Except... Sort. I'm completely baffled by this right now. LoadFolder... broke. Refresh, which just calls LoadFolder again... works. There should be no difference, I can't comprehend how there's a difference, or why, or what on earth is possibly going on to cause this... so, no estimate on sort

    UPDATE 2:
    Looks like code was being called out of order... if there were 10 items in the current folder, those 10 would be deleted before navigating to the next folder, but then the control received 10 DISPINFO requests, before any new items were added, throwing off everything. Added a manual flag to ignore DISPINFO requests coming at the wrong times.

    Sorting now works as normal, with the obvious caveat if you attempt to sort by anything besides name, the control will need to read all of the files first to figure out how to sort things. Might be able to adjust to not need to do that for size since it still had to be read in the initial load anyway, but that's a project for another day. As is full virtual mode... but do let me know how this performs, as I don't have that many files with metadata to test on. Tried about 2000 mp3s, which does the initial load in under a second (but it's not expected to be linear; the bulk of the time is reading the first page id3s). Virtual mode may or may not be a major advantage if disk access is the bottleneck here.


    REMOVED-SEE TWO POSTS DOWN FOR NEW VERSION

  8. #128
    Fanatic Member
    Join Date
    Jul 2007
    Location
    Essex, UK.
    Posts
    512

    Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature

    This is still much the same but now taking 18secs. Just so you know I am using DemoVB, so all I see are the filenames and their icon.

    Using FindFirstFileExW I can load all the filenames in the folder in 0.0363 secs but of course I am not trying to find the icon from the shell.

    It is unlikely to be disk access as Windows and my own tests (my tests are not virtual) do it so fast. From what I see, I think explorer gets all the filenames and using the standard music icon (in my case VLC) puts them in the listview. You then see the tags populating in the listview at a slower rate. My files are a 60/40 split Flac/mp3. I hope some of this is useful.

  9. #129

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    2,583

    Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature

    Hmm, could indeed be the icon lookups. You're using default settings right, with debug output off? And you mentioned you're loading things with the \DemoVB\ demo project--- that form has 3 instances of the control that are linked to eachother (if one navigates somewhere they all follow), so every time you load a folder in one you're loading directories 3 times in a row. You'll get a better idea of the true speed if you open the folder in a single control only.

    Here's a version that only looks up icons on demand as well, without looking up anything else if it's in List or small icon view.

    If that's not it, then it would have to be the name, type, or size lookups...

    One more idea here, the icons are set in LVSetStdIcon sub, perhaps changing GIL_FORSHELL to GIL_DEFAULTICON would speed things up, but as the name implies, you won't see custom icons for exes, shortcuts, etc.
    Attached Files Attached Files

Page 4 of 4 FirstFirst 1234

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