# VBForums CodeBank > CodeBank - Visual Basic 6 and earlier >  [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive features

## fafalone

*ucShellBrowse v11.2
Released 18 Jun 2022* | Jump to download
*About*
ucShellBrowse is a highly customizable UserControl meant to view the file system. It can be configured, very easily with the standard properties window, as simple as the old VB DirList/FileListBox, or up to all the major features of a full Explorer window, and everything in between.
This is basically having an updated, prettier version of VB's DirList/FileListBox, with further options that allow it to have the power of an actual Explorer window-- but doing it with a ComboBoxEx and ListView allow for customizations and features not possible if you were to simply host an instance of Explorer itself instead. It integrates many of the techniques my small sample projects have shown over the past few years.
Probably the most interesting thing you'll find is the deep dive into the Property System that was involved in recreating Explorer's Details Pane. There's the official documentation of course, but I've never seen any actual code in any language, let alone VB, that takes things all the way down to figuring out which properties should be in the detail bar set, what type of properties they are, listing ranges or combolists full of specialized items like the dozens of different 'Flash Mode' options on a photo, and actually editing and writing it all back on top of reading. 

*Key Features*
Explorer-style Details Pane that shows all the same fully formatted properties. Editing properties is supported, including pop-up DateTime and ComboBox controls where needed.Supports both dragging out and receiving dropped files, complete with the file icons you see in Explorer. Drops go through Explorer, meaning 3rd party shell extensions like WinRAR are supported.Dynamic Drag-Drop: Drop on a folder or zip file within the current directory.Keeps up with changes to the current directory by watching SHChangeNotifyFull Unicode supportIcons, display names, and properties are identical to what a user sees in Explorer. Includes overlay icons for things like shares or links; supports custom ones like used by DropBox or Github.Full navigation tree from the desktop-- virtual objects that are part of the file system, such as Computer or Libraries, are able to be used normally, and the selections real file system path is resolved and returned.In addition to the above, attached devices like phones, cameras, etc, can be navigated and used just like Explorer.Support for several different view modes: XL Icon, Large icon, Medium Icon, Small Icon, List, Details, Tiles, Contents, and Thumbnails.All column headers found in Explorer are available to be added/removed/sorted by/grouped by, directly interfacing with the Windows Property System and each files Property Store.Default column headers are loaded for each folder from Explorer; so when you browse to your Music library you get Artist, Album, Title, and Track as the columns (this behavior can be disabled)Thumbnail View uses the code from my ThumbsEx project, which goes beyond what Explorer can do by using GDI+ to center and frame images smaller than the thumbnail size. The thumbnail size can be set to any value.Optional setting to enable extended thumbnails, like video files showing the first frame.Images and all types with a registered preview handler can be previewed in an optional preview pane.'Group by' is fully implemented; can group for extended propertiesRight click brings up the standard shell context menuSort is supported for all columns and uses the same API that is used by Explorer, so order is identicalA filter can be applied to only show files matching a certain type (PathMatchSpecW); an option specifies whether it's single-select or multi-select.Supports rename-in-place with ListView LabelEdit, with blocks and warning popups to prevent disallowed characters. Renames are carried out through Explorer via IFileOperation.Rename, and other functionality, is still supported even if file name extensions are hidden (the ListView uses the Explorer displayname, so if they're hidden in Explorer they're hidden here)Supports 'Create new folder' where a new folder is created, with its name the next in sequence if needed, and a label edit to rename is automatically initiated.Optional status bar that shows the number of files, their total size, and menu item help. A custom message can also be set.The Back/Up/View control box can be shown or hidden; this combined with option to limit or turn off columns allows for compacting down to the same size as the original VB file browsing controls. ListView icons can even be hidden.There's substantial interaction with the host form, informing your program of selection change, clicks, double clicks/enter press, directory change, renames, and file drops. These events provide both full paths and references to the file(s) IShellItem(Array) interfacesThe startup path can be customized and is remembered. Options to start in the last path, or a completely blank display in no folder. The current path can be manually changed through a .BrowserPath property.Custom draw is used to show encrypted files in green and compressed files in blue to be consistent with Explorer (this can also be forced on or forced off)A footer bar can be added to the file list (like in Explorer search results).Explorer-style tool tips show details about the selected item; the properties shown depend on the file type, loading the same ones as Explorer does.Search box, with additional options in pop-up, launches a search of the current location and displays the results as a folder.Opens certain internet locations that Explorer can open. For example, you can set an ftp:// URL as the BrowserPath or Dropdown root, and the ftp site will successfully load.NEW: Highly portable - There's no BAS files, property pages, or additional classes. You need only add the .ctl and (recommended) manifest enabling Common Controls 6 if not already present, and just for the IDE, a single TLB reference.
There's also fairly extensive debug output to the Immediate window. You can stop it from appearing by changing the option: Private Const dbg_PrintToImmediate As Boolean = True --Change it to False to stop debug printing. This and other code options immediately follows the changelog in ucShellBrowse.ctl.

*Requirements*
-Windows Vista or newer
-If using this as a .ctl, your project must have a reference to oleexp.tlb v4.61 or higher (released 03 Oct 2019). 

(Tested on Windows 7 Ent, Windows 8 Pro, and Windows 10 1709/Fall Creators)

_Strongly recommended:_
-Common Controls 6.0 manifest (for a tool to make them, see LaVolpe's Manifest Creator). The control does work without this, but some features are missing/degraded. Button icons in the control box won't show up. The View mode (Details, Large Icons, List, etc) can't be changed at runtime. Group mode, tile view, thumbnail view, and footer items are all unavailable. When renaming, the extension can't be excluded by default.

The resource file in the download and used by the demo projects contains a manifest. It also turns on DPI awareness, since this control does its own high DPI support. There's an alternative file for the Demo project without DPIAware turned on, now included in the Zip instead of separate.


*Current Version: 11.2. Recent updates:
*
*Project Update: 11.2*
-I haven't had a ton of time to work on this between work and so many other projects, but I did want to release the few small feature updates and bug fixes that have been pending.

*Project Update: 11.1*
-Wanted to fix a few moderate severity bugs before a major refactor to address some issues. A couple minor features added as well.

*Project Update: Version 11.0*
-Added a few minor features, including enabling the ability to start a selection marquee in the whitespace of a column like in Explorer, and fixed a number of bugs identified by running it more on Windows 10; Microsoft unexpectedly changed the way a few older APIs worked, among other issues.

*Project Update: Version 10.0 Revision 3/4*
Revision 4: The fix introduced to stop crashing with a Thicker border was incorrectly applied to the ListView as well, and this caused graphical glitches when resizing the control too short as the ListView locked and the Details Pane and/or StatusBar were drawn on top of it.

Revision 3: The minimum control height for FilesOnly/Dir+Files was applied at runtime for other modes, creating a big empty space below the control, potentially on top of other objects on your form.
I swear I could bug test for a month straight 24/7, then still find something I missed a day later  :Blush: 

*Project Update: Version 10.0 Revision 2*
Had one bug still manage to sneak by  :Frown: 
If your startup mode is FilesOnly, but SearchBox was True, if you then switched to a mode that shows the Directory bar during runtime, the SearchBox would not show up, even if you toggled it off and on.
Added the new demo from the 10.0 release post to the zip.

*Project Update: Version 10.0*
This version update has been adapted and finalized from 9.6 R3/9.7 with several more features/fixes.
Every time I went to save 9.6R3/9.7, a new bug popped up. After it happened a bunch of times, I pulled the entire project entirely. Then, I conducted a thorough review of every single Property and Public method in the control, fixing numerous additional bugs in the process.
With that and a few more features, it's time for a Major Version bump. 10.0 is the most tested version of ucShellBrowse ever.

See the log below for a full list of new features and the extensive bug fix list.

------------


```
'New in v11.2 (Released 18 Jun 2022)
'
'-Added SearchAutoGroup to automatically group search results. The default is to
' group them by folder, but you can change that via the szAutoGroupSearchCat
' User Option.
'
'-In addition to below specific bug identified, added a more robust system of
' ensuring duplicates are not added by receiving duplicate ShellNotify messages.
'
'-SelectedFiles (Let) and FileSetCheck are no longer case sensitive.
'
'-Now use Unicode-aware width calculations in Details Pane.
'
'-(Bug fix) In Computer/This PC, for some Windows versions removing a USB device
'           then plugging it back in could result in duplicate entries.
'           Also improved entry remover to better handle these.
'
'-(Bug fix) SelectedFileSet ignored bDeselectOthers flag.
'
'-(Bug fix) The control improperly reported the Windows version due to Microsoft
'           breaking most version functions to require a manifest specifying 10
'           compatibility or else it deliberately reports Windows 8. This didn't
'           impact functionality as the only version-restricted features were
'           Vista+ to run at all, and Windows 8+ for some Bookmarks folders.
'
'-(Bug fix) Since version 9.4, pressing enter in the Search Box accidentally
'           had the code to use the legacy search enabled. That would be conducted
'           first, then the new search would be conducted. This doubled (at least)
'           the search time and created a duplicate folder.
'
'-(Demo)    The Demo manifest, with the preferred settings, has been updated to
'           include compatibility flags, trust info, and newer dpi awareness.
'
'
'New in v11.1 (Released 02 Feb 2022)
'
'-Provided some advanced item data access. zz_ExportSelectedItemFullData and
' zz_ExportItemFullDataByPos export the full internal item data structure.
' How to use these:
'   Step 1: Copy type definitions for UCSBFile, UCSBF_ColLink, and ColumnCache
'           to the calling form/module.
'   Step 2: Declare a UCSBFile variable, and 3 Long's to be passed as arguments
'           for the function: One to receive the memory pointer, and array
'           bounds for the LinkCols and ExtColData arrays in UCSBFile.
'   Step 3: Redim UCSBFile.LinkCols(nLinkCol) and UCSBFile.ExtColData(nExtColData)
'   Step 4: CopyMemory to UCSBFile from ByVal pData (only if function returns >0!)
'   Step 5: You *must* zero out the structure with ZeroMemory before the procedure
'           exits, otherwise it will free the strings and objects, likely causing
'           a crash when the control tries to access them again.
'  Note: As Step 5 might suggest, you must treat the structure as read-only.
'        Attempting to change values could result in instability or crashing.
'        This access is not meant for casual use; unless you really know the ins
'        and outs of passing structures like this you're better off just adding
'        an export for the fields you need.
'
'-Also added InvokeKeyPress to invoke a key press on the ListView by code. Has
' options for Shift/Control/Alt and whether to raise the ListKeyDown event.
'
'-CustomColor event now includes dwState argument that passes the CDIS_* values
' in NMLVCUSTOMDRAW.iStateId.
' ***EVENT PROTOTYPES ON YOUR FORMS MUST BE UPDATED!***
'
'-Set the ListView LabelEdit edit box length limit to MAX_PATH, to avoid an error
' when attempting rename.
'
'-(Bug fix) In high performance mode, showing hidden would also show superhidden
'           as the FILE_ATTRIBUTE_SYSTEM attribute wasn't checked.
'
'-(Bug fix) SelectedFile(Let) and SetSelectedFile selected the wrong file.
'
'-(Bug fix) If FileExtensions was set to AlwaysShow, drive names in This PC would
'           not be displayed at all, and some virtual items displayed GUIDs.
'
'-(Bug fix) When switching into some view modes without ComCtl6, an "Invalid
'           Window Handle" error would be displayed.
'
'
'
'New in v11.0 (Released 25 Jan 2022)
'
'-Added option ExplorerStyleSelection. Makes the ListView work like Explorer; if
' in Details View with Multiselect enabled, you can start a marquee to select
' multiple files by dragging in the whitespace of the Name column, rather than
' need to go off to the side. Enabled by default.
' Note: Does not work in Windows Vista.
' Note: This is an undocumented ListView feature. As such, it may be dropped from
'       future versions of Windows. However, it's confirmed to be working in
'       Windows 10, and it will simply stay with the old selection style if the
'       call fails, it will not break the control.
'
'-Added ClearSelection method to deselect all items.
'
'-Added new public SelectedFileSet sub with more options; allows select/deselect,
' separate option for focus, option to deselect all others, and ensure visible.
' SelectedFile (Let) wasn't changed since optional arguments aren't allowed and
' adding non-optional ones would break people's existing code.
'
'-SelectedFile (Let) is no longer case sensitive, since filenames are not.
'
'-New SetSelectedItemsEx function that provides a far more robust way of selecting
' files. Supports wildcards for selecting many, limiting to files or folders,
' setting a match limit, and more.
'
'
'-(Bug fix) High performance mode was broken on Windows 10.
'
'-(Bug fix) On some special editions of Windows 10, including LTSC, special folders
'           are not included, causing the Bookmarks menu to not show due to a bug
'           in handling errors generating that submenu.
'
'-(Bug fix) Some FILETIME and RECT types weren't explicitly defined, leading to
'           naming conflict errors in certain scenarios.
'
'-(Bug fix) On some versions of Windows 10, Special folders in This PC were grouped
'           with the drives.
'
'-(Bug fix) On Windows 10, some Security Zone icons failed to load.
'
'-(Bug fix) Keyboard focus never went to ucTreeView when on a form w/ ucShellBrowse.
'
'-(Bug fix) The arrow keys wouldn't work on the first click of the ListView.


'New in v10.0 R4 (Released 29 Apr 2021)
'
'-Updated GetPropertyDisplayString snd GetPropertyKeyDisplayString to handle arrays
' in the manual fallback handler for properties without an IPropertyDescription.
'
'-(Bug fix) When the StatusBar and/or DetailsPane was enabled, resizing the control
'           below a certain point caused the ListView to stop resizing, forcing the
'           bar and pane onto it, causing graphical glitches. This was related to
'           the fix put in place to stop crashes from resizing a thicker border too
'           low; that code fired when it shouldn't.
'New in v10.0 R3 (Released 29 Apr 2021)
'
'-(Bug fix) The minimum height for the control was being enforced, but was not
'           appropriate for DirOnly/DriveOnly/DirOnlyCtl, which left a big chunk
'           of blank space under the control that might cover up other objects on
'           your form.
'
'New in v10.0 R2 (Released 28 Apr 2021)
'
'-(Bug fix) If the Search Box was enabled, but the mode set to FilesOnly, then you
'           changed to Dir+Files or other mode with the top bar, the Search Box
'           did not become visible along with everything else.
```

If there's another feature you'd like to see don't hesitate to suggest it  :wave: 

*Works with the ShellTree control*If you'd rather use a TreeView to navigate (or even choose files), you might be interested in ucShellTree, my new Shell Tree Control. Like this project, it implements nearly all of the functionality from Explorer and some additional ones. 
It works seamlessly with this project-- see the ucShellBrowse DemoEx sample (it also works stand-alone). As shown on the right, there's even an option to signal showing/hiding it from the ShellBrowse Layout menu.





Enjoy!


*NEW!* I'm also now distributing ucShellBrowse and ucShellTree together as a compiled OCX, complete with SxS resources to create registration-free distributions.

[VB6] Shell Controls OCX (Updated with ucShellBrowse 11.0)

----------


## fafalone

Known Issues

The following are bugs known to exist in the current version. They will be fixed in the next update if possible, but I include fixes here in case it's something you can't wait for.

Certain special locations on Win10, such as Quick Access, have been designed to deliberately break 3rd party programs such as this. They expose an ICategoryProvider, supply a default categorization key, but attempting to obtain the ICategorizer causes an error. This results in the folder not loading at all as a hard error like this wasn't handled. A workaround is available by adding the bolded lines around the following line in LVLoadFolder:


```
                        On Error Resume Next
                        pCatProvider.CreateCategory tSCGUID, IID_ICategorizer, pcppv 'pCatG '
                        On Error GoTo e0
```

This allows the folder to load, and items can be used. However, special properties (e.g. Pinned in Quick Access) are mostly unavailable, as Microsoft has apparently deliberately broken them; they'll load for one or two items but not all of them, which can only be explained by deliberately making it incompatible.

An app crash occurs if you refresh This PC 10 times or more. I'm investigating the cause. It may potentially be fixed in the current version (11.2) but I'm not confident enough to remove it yet.


_Long-term issues with Windows or VB6 IDE_
(Intentional Windows behavior, workaround available) When you run this program, or any program, as Administrator, in Windows 10 and above Mapped Network Drives do not show unless either you re-map them from an elevated process, or in Registry Editor, navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System and create a new DWORD named EnableLinkedConnections and give it a value of 1. You can re-map the drives within ucShellBrowse (and ucShellTree) too: Navigate to the Desktop, then (if EnableShellMenu is True), right clicking 'This PC' will have the 'Map network drive...' option--- NOTE: While the mapping will appear in the dialog, complete it again anyway. After that, a Refresh will show the newly remapped drive going forward, in all apps, not just the one with ucShellBrowse.
(Not well understood, workaround) There may be an issue with the control going striped then appcrash after modifying other controls when there's two UserControls on the same form, similar to the last one. This time it appears to be APIs that are triggering it. I don't understand the precise cause or complete set of circumstances, so if this is a problem for you, for now just don't include any Public APIs in the module with your Sub Main. 
Another triggering circumstance seems to be if an Enum value from the bas with Main is defined in the TLB but not the UserControl and used in the control.

(Unfixable, partial workaround) When OS zoom is set to other than 100% and dpiAware is not enabled in the manifest (or 'Disable display scaling on high-DPI settings' checked on the Properties->Compatibility tab), use of the shell context menu triggers graphical glitches. Subsequent right-clicks will have the menu pop-up nowhere near where clicked, and if running from the IDE all sorts of distortions in it. 
There's no known fix for this issue, which effects numerous VB6 apps. If you use 100% scaling, it won't effect you, otherwise, the workaround is using the dpiAware=true or 'Disable scaling' options; ucShellBrowse is DPI-aware and scales itself.
(Unfixable, possible workaround) If you have 64-bit Microsoft Office installed and its msoshext.dll is the registered property handler for post-2007 Office files (typically those with an 'x' in the extension, .docx, .xlsx, etc), you will not be able to view/edit the custom properties like Author, Title, etc in the Details Pane or display columns. There does not seem to be any possible fix for this, as there's no way to load a 64-bit property handler from a 32-bit application; CoCreateInstance with the flags that are supposed to can't create the class. Nor is there a way to specify difference property handlers for 32bit apps vs. 64bit apps that I'm aware of. Only option would be to install 32bit Office instead.
(Unfixable, no workaround) In a similar bug, while the control can load the Programs and Features control panel applet, it can only display the 32-bit programs.




Examples of Different Configurations and Features


Full, tight integration with the ucShellTree control.


_New features: Showing the parent tree in the list (left), and loading the children of the selected folder in DirOnly/DirOnlyWithCtls modes (right)._ 


_You can configure it to be a simple thumbnail list, which includes thumbnails of embedded mp3 album art as shown on the right. Note that Windows doesn't come with a built-in FLAC handler, but if you install a 32-bit one, the control will be able to read/write those too._


_Any property that's able to be edited can be set through the control, including through a popup date/time control or dropdown list where needed._


_Multiple controls can be placed on the same form to create different layouts._


_Turn the control into a Font Previewer. The root is set to the fonts folder; navigating elsewhere is disabled. Fonts with multiple styles appear in the dropdown, selecting them there or double clicking loads the list of individual styles for previews and info._ 


_The Computer/This PC folder shows bars for the percent full in Details/Tile/Contents views, and automatically groups by drive type._


_You can add a custom footer bar, and there's InfoTips that show a selection of properties, like Explorer does.
_

_Progress marquee while loading folders_


_Popup frame that allows you to select columns. The picture on the left shows the frame as it initially appears. Shown on the right is the two advanced options: The filter bar, which lets you search for the property you want, and Advanced Mode-- This shows a whole bunch of properties not normally accessible as column options; because many of them are either not text, inapplicable to normal files/folders, or otherwise not suitable for being a display column. But many of them are valid as columns, such as the GPS properties shown above._ 


_You can add entirely custom columns. An event is raised for each file giving the names/paths/shell interface to it, and you can specify the column data. As shown above, these custom columns have the option to support images._


_You can specify a custom root, and browse FTP sites._


_Certain columns have hyperlinks, this controls supports them._


Group by any property, and view the standard Explorer right-click context menu.


_Custom font, tiled background, and no border._


_Ratings stars, subsetted groups, custom foreground and background colors_


_Automatically populated Special Folders submenu for the Bookmarks menu._


You can open special locations like 'Devices and Printers' and 'Programs and Features', and use the right-click menu to carry out their custom actions like Uninstall a program, or Set As Default for a printer.


The search feature. You can start a quick search by just typing a string in the box on the form and pressing enter, or double-click the box to bring up the popup with additional options. You can optionally have the control box disabled, but have a menu item on right-click that brings up the popup (with additional box to type text in).


*Notes**Using the control*
The control can be used as either a regular UserControl, or can be compiled into an OCX. Since the control is now entirely self-contained, I recommend just adding the .ctl to your project. The control is added via the Project->Add UserControl menu option. Make sure ucShellBrowse.ctl and ucShellBrowse.ctx are in the same directory, but you only add the .ctl. As noted above, you need to go to Project->References and make sure oleexp.tlb (OLEEXP - Modern Shell Interfaces for VB6) is listed added as a reference when using the control this way, but once again, you need not distribute the typelib with your exe, it's only for the IDE. 
Once added, you can add the control to a form and it will be created with the default options. The pictures at the top of this post, and in the post that follows, show the incredible diversity of the control. The major options you'll want to look at first include:
ControlType - The default is 'Directory and Files', which shows the combobox with the folders dropdown, and the listview with the files. You can change that to Directories Only or Files Only, with the former having two additional modes, Drives Only, and Directories Only With Controls, which instead of being a plain combobox, also shows the Back/Forward, Up, View, Bookmarks, and Search Box controls-- all of which can be independently set to be shown or hidden (in the Directories Only mode, they're all hidden regardless of the individual settings, which is why this is a separate mode). 
ViewMode - This sets the initial view type of the ListView with the files. All modes are supported for startup: The default is Details, and the others are Small Icons, Medium Icons, Large Icons, XL Icons, Tiles, Content, List, or Thumbnails (size set via ThumbnailSize option). Not all modes can be viewed in the IDE Design Mode, but will be when the program runs. 
BrowserPath - The value entered here will be used for startup. It defaults to App.Path. There's also the following options: BrowserStartLast (start in the last path the control was viewing; uses the BrowserPath value the first time), or BrowserStartBlank, to not load any folder. 
ComboType and ComboCanEdit - The default is a typical dropdown, but you can change it to DropdownList or Simple. Allowing editing permits typing in a full path, a folder name in the current path, environmental variable shortcuts, or custom shortcuts (see the ValidateTextNavigate event). There's also the AutoComplete option, which is available but disabled by default.
CustomRoot, CustomRootLocked, and ComputerAsRoot - By default, the directory dropdown, like Explorer, has its root as the Desktop. You can change that to Computer (This PC in Win10) with the ComputerAsRoot option, or specify an entirely custom path. The custom path can be anywhere the control can navigate, including special locations, network locations, and FTP addresses. The CustomRootLocked option will limit browsing to the root folder and its children, not allowing the user to navigate anywhere else in the file system.

So those are the major options to look at when first configuring the control. After that, there's many, many other options from the color options, to layout options for all the individual elements, to numerous details about how the file view works. You'll want to read through each option, they all have descriptions that describe what they do.

*Compiling to OCX*
It's very simple to use the control as an OCX: Open ShellBrowse.vbp from the main folder, in the properties for the control, change Public to True, you can then compile. Then proceed to move, register, and use as you would any other .ocx. A project with the OCX _does not_ require oleexp.tlb. If needed I could also send the compiled OCX, just ask here or PM. 

The demo projects use the control as a .ctl.



*Multiple Controls*
You can have more than one ucShellBrowse on a form. If you want to have them linked, like one with the directory dropdown only, then one with files only elsewhere on the form, you'll need to change the path in one when the other changes:


```
Private Sub ucShellBrowse1_DirectoryChanged(ByVal sFullPath As String, siItem As oleexp.IShellItem, pidlFQ As Long)
ucShellBrowse2.BrowserOpenItem siItem
End Sub

Private Sub ucShellBrowse2_DirectoryChanged(ByVal sFullPath As String, siItem As oleexp.IShellItem, pidlFQ As Long)
ucShellBrowse1.BrowserOpenItem siItem
End Sub
```

Note: This section previously indicated usage of a variable to detect if a manual change was happening to prevent an infinite loop, but that need was eliminated by adding a sanity check to the control many versions ago now, so all you need is the above.
Also, to make sure virtual objects are navigated correctly, it's best to use BrowserOpenItem instead of BrowserPath. 

*Printing Directory List*
This is a pretty common usage, which is why I added the simple .Files(), .Folders(), etc. But what if you want to output a fancy list:

This is done in a project form rather than the .ctl. First, add oleexp addons mIID.bas and mPKEY.bas (if copying from here; the demo project in the zip has its own copies of the needed UUIDs/PKEYs). Second, in a module we'll borrow some support code from the control:


```
'(See Form1 in the Demo folder for the 3 API declares used below if you don't already have them.)

Public Function LPWSTRtoStr(lPtr As Long, Optional ByVal fFree As Boolean = True) As String
SysReAllocString VarPtr(LPWSTRtoStr), lPtr
If fFree Then
    Call CoTaskMemFree(lPtr)
End If
End Function
Public Function GetPropertyKeyDisplayString(pps As IPropertyStore, pkProp As oleexp.PROPERTYKEY, Optional bFixChars As Boolean = True) As String
'Gets the string value of the given canonical property; e.g. System.Company, System.Rating, etc
'This would be the value displayed in Explorer if you added the column in details view
Dim lpsz As Long
Dim ppd As IPropertyDescription
PSGetPropertyDescription pkProp, IID_IPropertyDescription, ppd
If ((pps Is Nothing) = False) And ((ppd Is Nothing) = False) Then
    PSFormatPropertyValue ObjPtr(pps), ObjPtr(ppd), PDFF_DEFAULT, lpsz
    SysReAllocString VarPtr(GetPropertyKeyDisplayString), lpsz
    CoTaskMemFree lpsz
    If bFixChars Then
        GetPropertyKeyDisplayString = Replace$(GetPropertyKeyDisplayString, ChrW$(&H200E), "")
        GetPropertyKeyDisplayString = Replace$(GetPropertyKeyDisplayString, ChrW$(&H200F), "")
        GetPropertyKeyDisplayString = Replace$(GetPropertyKeyDisplayString, ChrW$(&H202A), "")
        GetPropertyKeyDisplayString = Replace$(GetPropertyKeyDisplayString, ChrW$(&H202C), "")
    End If
    Set ppd = Nothing
Else
    Debug.Print "GetPropertyKeyDisplayString.Error->PropertyStore or PropertyDescription is not set."
    
End If
End Function
```

Then we get to the code to do it. Before calling this, do Select All (Ctrl+A) manually (since there's no other way in this version to get an array of all items)... then with everything selected:


```
Private Sub Command3_Click()
On Error GoTo e0

Dim pArSel As IShellItemArray
Dim siChild As IShellItem, si2 As IShellItem2
Dim pst As IPropertyStore
Dim nItems As Long
Dim lpsz As Long, sTmp As String
Dim sOut As String
Dim dwAtr As SFGAO_Flags
Dim i As Long

Set pArSel = ucShellBrowse1.SelectedItems
pArSel.GetCount nItems
Debug.Print "         Name                  Size          Date Modified     Attributes"
Debug.Print "---------------------------------------------------------------------------"
For i = 0 To (nItems - 1)
    pArSel.GetItemAt i, siChild
    If siChild Is Nothing Then
        Debug.Print "No child"
        Exit Sub
    End If
    
    Set si2 = siChild
    siChild.GetAttributes SFGAO_FOLDER, dwAtr
    If (dwAtr And SFGAO_FOLDER) = SFGAO_FOLDER Then
        sOut = "<DIR> "
    Else
        sOut = "      "
    End If
    siChild.GetDisplayName SIGDN_NORMALDISPLAY, lpsz
    sTmp = LPWSTRtoStr(lpsz)
    sOut = sOut & sTmp
    sOut = sOut & Space$(30 - Len(sOut))
    
    si2.GetPropertyStore GPS_OPENSLOWITEM Or GPS_BESTEFFORT, IID_IPropertyStore, pst
    
    sTmp = GetPropertyKeyDisplayString(pst, PKEY_Size)
    sTmp = Space$(13 - Len(sTmp)) & sTmp & "  "
    sOut = sOut & sTmp
        
    sTmp = GetPropertyKeyDisplayString(pst, PKEY_DateModified)
    sTmp = sTmp & Space$(20 - Len(sTmp))
    sOut = sOut & sTmp
        
    sTmp = GetPropertyKeyDisplayString(pst, PKEY_FileAttributes)
    sTmp = "-" & sTmp
    
    sOut = sOut & sTmp
    
    Debug.Print sOut
    Set pst = Nothing
Next i
pArSel.GetPropertyStore GPS_BESTEFFORT Or GPS_OPENSLOWITEM, IID_IPropertyStore, pst
If (pst Is Nothing) = False Then
    sTmp = GetPropertyKeyDisplayString(pst, PKEY_Size)
    Set pst = Nothing
Else
    sTmp = ""
End If
Debug.Print "---------------------------------------------------------------------------"
Debug.Print "                             " & nItems & " items                 " & sTmp
Exit Sub

e0:
    Debug.Print "Form1.Command3_Click->Error: " & Err.Description & ", 0x" & Hex$(Err.Number)
End Sub
```

Changing to text output is just a matter of replacing Debug.Print with a write to a text file.


LocalizationThis project contains a large number of English-language strings, which presents a problem for users who speak another language. The code in Version 5.3 was reorganized to make localization as easy as possible: all of the text* is located in one place; near the top of the control in the User Consts section just below the changelog. Control captions are set from this section as well. So for example, to turn the whole thing French-


```
'Control captions:
Private Const scc_Up = "Haut"
Private Const scc_Back = " Retour"
Private Const scc_Forward = "Svnt"
Private Const scc_View = "Vue"
Private Const scc_Ok = "OK"
Private Const scc_Cancel = "Annuler"
Private Const scc_Save = "Enreg."
Private Const scc_ChCols = "Colonnes"
Private Const scc_Prv = "Aperçu"
Private Const scc_Width = "Largeur"
Private Const scc_PropCol = "Propriétés"
'These are applied to the controls always; changing the caption in the Properties window has no effect at runtime.

Private Const mn_sMore As String = "Plus..."           'There's no system resource to load localized translations like the other items
Private Const mn_sLock As String = "Garder memes colonnes" 'on the column menu, so you may change it manually here if you wish
                                                       'Note: The lock item won't appear if columns are locked through the LockColumns property
Private Const mn_sLW = "Bloquer largeur"
Private Const mn_sLH = "Bloquer hauteur"
Private Const mn_sSel = "Selectionner"
Private Const mnv_sGrpHdr = "Grouper par"
Private Const mnv_sSortHdr = "Trier par"
Private Const mnv_sSortAsc = "Ordre croissant"
Private Const mnv_sSortDsc = "Ordre décroissant"
Private Const mnv_sli As String = "Grandes Icônes"
Private Const mnv_sSM = "Petites Icônes"
Private Const mnv_sLS = "Liste"
Private Const mnv_sDT = "Détails"
Private Const mnv_sTV = "Tuiles"
Private Const mnv_sCT = "Contenu"
Private Const mnv_sJM = "Vignettes"
Private Const mnv_sNN = "(aucun)"
Private Const mnv_sNF = "Nouveau dossier"
Private Const mnv_sPR = "Propriétés"
Private Const mnv_sRF = "Rafraîchir"
Private Const mnv_sSB = "Barre d'état"
Private Const mnv_sPV = "Volet aperçu"
Private Const mnv_sDB = "Barre de détails"
Private Const mnv_sPS = "Collez"
Private Const mnv_sBK = "Signets"
Private Const m_def_GroupSubsetLinkText As String = "Plus de fichiers..."
Private Const m_sColCap As String = "Choisir des colonnes"

'(and so on. A number of strings have been omitted because of the post character limit, and before that it was many versions out of date anyway. Please consult the control itself for remaining items to translate.)
```





Since I don't want to make a particular resource file mandatory, I didn't set this up as a string table in one, but you could easily set that up too with everything in one place like this. Did the best I could for the circumstances.
And please forgive me if I got something wrong in my example, I was nearly fluent but haven't used French in about 13 years now.

* - The column names in the ListView, and the column data itself, are loaded from Windows, and thus will already appear in whatever the current system language is.

Alternative Resource Files*UPDATE:*  As of Version 8.0, all images are now built into the control. You no longer need to worry about keeping them together, you only need the .ctl and .ctx. The alternative manifest for the demo with DpiAware set to False is now included in the main download. It's now possible to simply add the .ctl to your project with an existing resource/manifest, and nothing else need be done. No more separate images! Thanks go to LaVolpe and The_trick.


Image EncoderAs per above, the icons have been encoded into the .ctl. The binary data from the icons was encoded into a bitmap, which could then be set as the image for a picturebox, and then be decoded back to binary data and processed as an icon/png file. All of the default icons are now built into the control as images in a picturebox that are decoded to binary data. If you wish to add additional images to the control (or use the method in your own project), I'm attaching the tool I developed around The_trick's code. The decoding function is also included but not used. There are no dependencies.
You do not need to have this or do anything with this to run the control complete with the default images, just to add additional images beyond the ones it comes with, or to replace the images already contained in it.

NOTE: Since so many people were downloading this tool, I developed it into a more formal sample, complete with a demo to decode things. You'll find this tool here:
[VB6] Encode binary data to bitmap for use in a PictureBox

----------


## MountainMan

Nice start. This is going to be very useful. Some feedback from running your demo:

1 - The preview pane is slightly larger than the details pane and it covers the top bit of the status bar.

2 - It would be very nice to be able to drag between the details and preview panes to resize both together in the x-axis.

3 - The button to the right of the Back button never is fully displayed even if the overall window is dragged to the right. I can't tell what the text in the box is although I can see a check mark displayed in the box.

4 - When I cycle through large icons, small icons, etc. by the time I get back around to Details the column headers are there but no text is shown except in the first column.

----------


## fafalone

*Public Methods*The Properties all appear in the Properties Box and have descriptions attached to them, so here's the same thing for public Subs, Functions, and runtime Properties (ones that do not appear in the Properties Box). List is complete as of v11.0.

*Functions & Subs*

AddColumn
Manually add a column to Details View by a system property name, e.g. System.DateModified

AddColumnByPKEY
Same as above, except by PROPERTYKEY. Since you cannot pass one directly, pass VarPtr(pkey)

AddCustomColumn
Adds a custom column with the specified options. An event is raised to ask for item data.

AppendCustomFolder
If you're displaying a custom folder, adds an additional file or folder.

AutocompleteFlagAdjust
For changing the default autocomplete flags, both AUTOCOMPLETEOPTIONS and AUTOCOMPLETELISTOPTIONS.

Bookmarks (Get/Let)
Manually view or set the bookmarks data, format: path1|path2|path3 etc

BrowserOpenItem
Navigate to a location represented by an IShellItem

BrowserPathItem (Get/Let)
Gets an IShellItem reference for the current location or navigates to the one passed.

BrowserPathPidl (Get/Let)
Set or retrieve the current location by fully qualified PIDL

ClearSelection
Deselects all ListView items

ComboSetFontByHandle
Set the ComboBox font directly by HFONT

ComboSetFontOLE
Set the ComboBox font directly by HFONT

ControlBarHeight
Returns the current height of the control bar.

CreateCustomFolder
Adds a folder with a set of manually given files from anywhere on the system. May only have one, but search results are separate.

DebugLogInsertMessage
If debug logging is enabled, manually insert an entry.

DetailsPaneHeight (Get/Let)
Get or manually set the height of the Details Pane.

DetailsPaneHeightLocked (Get/Let)
Sets whether the user can adjust the height of the Details Pane.

DetailsPaneWidth (Get)
Retrieves the width of the Details Pane.

DialogGUID (Get/Let)
The 'Custom' button in the built-in search footer bar loads a common dialog, set a unique GUID to prevent the last path chosen in it from being the last path for any common dialog your app opens, or to share one between controls. More details.

DisplayCustomFolder
If a custom folder has been created with CreateCustomFolder, opens it.

DPIScaleX (Get/Let)
Retrieve or manually set the current DPI scaling factor for width.

DPIScaleY (Get/Let)
Retrieve or manually set the current DPI scaling factor for height.

ExecFileSearch
Initiates a custom search in the current folder for the specified patttern.

ExecFileSearchEx
Initiates a custom search with an IShellItem location and ICondition search parameters object.

FileCount
A function that returns the number of files (does not include folders, or zip files if zip navigation is enabled)

FileGetCheck
Specifies if the given file or folder name (in the current folder, name only) is checked.

FileGetProperty
Returns the property, by system name (e.g. System.Keywords), for the given file or folder (in the current folder, name only)

FileGetPropertyByPKEY
Same as above, except by PROPERTYKEY. Pass VarPtr(pkey)

FileItemFromPos
Returns an IShellItem for the file at the specified numerical position in the file list.

FilePathFromPos
Returns the full path for the file at the specified numerical position in the file list.

Files()
Returns an array of the file names (but not folders) in the current directory.

FilesChecked()
Returns an array of the file that are checked (file names only).

FilesCheckedCount
Returns a count of all files (excluding folders) that are checked.

FilesCheckedFull()
Returns an array of the files that are checked (full paths).

FilesSelected()
Returns a list of only the selected files (i.e. selected folders not included)

FilesSelectedCount (Get)
The number of files, excludes folders.

FilesSelectedFull()
The full paths version of the above.

FileSetCheck
Sets (1) or clears (0) the check status of a given file or folder by name (current folder, by name only).

FilesFullParsing()
Returns an array of full paths for files (not folders) in the current directory. Can specify a filter.

FilterBarApplyManually
Simulates typing something into the Filter Bar (whether or not it's currently shown).

FolderCount
A count of folders, including zip files if zip navigation enabled, in the current directory.

Folders()
Returns an array of all folder names in the current directory.

FoldersChecked()
Returns an array of all folder names that are checked.

FoldersCheckedCount
Returns a count of all folders that are checked.

FoldersCheckedFull()
Returns an array of all folder full paths that are checked.

FoldersFullParsing()
Same as above, only full paths.

FoldersSelected()
Returns a list of only the selected folders (i.e. selected files not included)

FoldersSelectedCount (Get)
Returns a count of only the selected folders (i.e. selected files not included)

FoldersSelectedFull()
The full paths version of the above.

FooterAddButton
Adds a button to an already existing footer bar.

FooterClearButtons
Removes all buttons from the footer bar.

FooterCreate
Creates a footer bar at the bottom of the file list (undocumented ListView feature).

FooterRemove
Removes the footer bar.

GetCurrentColumnCount
Retrieve the current column count.

GetCurrentColumns
Retrieves the information about currently displayed columns.

GetGroupColumn
Gets the column index that files are grouped by; returns -1 if grouping is disabled.

GetHistoryData
Retrieves the history buffer for the control's History menu and Back/Forward.

GetPidlStoreEntry
The control keeps a list of fully qualified pidls for each path loaded, this retrieves one by path.

GetSortColumn
Retrieves the column that items are currently sorted by.

GetSortDirection
Retrieves whether sorting is ascending or descending.

GroupCollapseGroups
Sets if a group (or all groups if you pass -1 as the index) is collapsed (0) or not (1).

GroupSetIcon
Assigns the given icon in the system image list to a group header.

HighlightColumn
Highlights the given column by index in the specified color.

HighlightColumnByProperty
Same but you identfy the column by its property (system name, e.g. System.Size)

hWnd_______ (Get)
Retrieves the hWnd of various components of the control (separate propgets for each rep'd by blank).

InvokeColumnSelection
Brings up the dialog box for choosing columns.

InvokeGroupByColumn
Group items by the given column index.

InvokeGroupByPKEY
Group items by the given PROPERTYKEY (passed by VarPtr(pkey)).

InvokeInvertSelection
Inverts which items are selected.

InvokeNewFolder
Creates a new folder and initiates a label edit to rename it.

InvokeSelectAll
Select all items.

InvokeSortAscending
Sorts items in ascending order of the current sort column.

InvokeSortByColumn
Sort items by the given column index.

InvokeSortByPKEY
Sort items by the given PROPERTYKEY (passed as VarPtr(pkey)).

InvokeSortDescending
Sorts items in descending order of the current sort column.

ItemIsFolder
Determine if a file-view item is a folder by position, name, or full path.

Items()
Returns a list of both file and folder names.

ItemsChecked()
Returns a list of both file and folder names which are checked.

ItemsCheckedCount
Returns the total number of files+folders checked.

ItemsCheckedFull()
Returns a list of both file and folder full paths that are checked.

ItemsFullParsing()
Returns a list of both file and folder full paths.

ItemsSelected()
Returns a list of both selected file and folder names.

ItemsSelectedCount
Returns the total number of files+folders selected.

ItemsSelectedFull()
Returns a list of the full paths of all selected files and folders.

ListViewSetFontByHandle
Set the ListView font directly by HFONT

ListViewSetFontOLE
Set the ListView font directly by StdFont

LogActive (Get/Let)
Sets whether the debug log file output is active.

NavGoBack
Navigate to the previous directory.

NavGoForward
Navigate forward through history if available.

NavOpenParent
Navigate to the parent of the current location ('Up')

PictureSetByHBITMAP
Sets a background image in the file list by passing an HBITMAP.

PictureSetByURL
Same as above but by URL.

PreviewPaneHeight (Get)
Gets current Preview Pane height.

PreviewPaneWidth (Get/Let)
Retrieve or manually set the width of the Preview Pane.

PreviewPaneWidthLocked (Get/Let)
Sets whether the user can adjust the width of the Preview Pane.

RedrawList
Redraws the list items without reloading the folder (useful for color changes).

RefreshPreview
Reloads the contents of the Preview Pane

RefreshTree
Rebuilds the directory dropdown. Only the current location will remain expanded (besides defaults).

RefreshView
Reloads the current location.

RemoveColumnByPKEY
Manually remove the specified column.

RemoveColumnByPropName
Manually remove the specified column.

RemoveCustomColumn
Manually remove the given custom column.

ScaleHeight (Get)
Returns the ScaleHeight of the control.

ScaleWidth (Get)
Returns the ScaleWidth of the control.

SelCount (Get)
Returns the number of items selected.

SelectedColumn (Get/Let)
The currently selected (i.e. last clicked) column.

SelectedFile (Get/Let)
The currently selected (and focused, if multisel) file name.

SelectedFileGetProperty
Gets a property of the currently selected (and focused if multisel) file by system name.

SelectedFileGetPropertyByPKEY
Same but by PROPERTYKEY. Pass VarPtr(pkey).

SelectedFilePath (Get)
Full path to selected (and focused, if multisel) file.

SelectedFiles (Get/Let)
A Variant array of selected file names or file names to select.

SelectedFilesCount (Get)
The number of files, excludes folders.

SelectedFilesPaths (Get)
String array of full paths of selected files.

SelectedFileSet
Provides expanded options for setting the selected file: Deselect others, ensure visible, and set focus.

SelectedItem (Get)
An IShellItem reference to the currently selected (and focused if multisel) file.

SelectedItems (Get)
An IShellItemArray of all selected items.

SetAdvancedStringSort
Use CompareStringEx with the given params instead of StrCmpLogicalW

SetCustomComboImageList
Set an alternate imagelist for the dropdown. (Setting items not yet implemented)

SetCustomListViewImageLists
Set an alternate imagelist for the ListView. (Setting items not yet implemented)

SetFocusOnDropdown
Sets focus on the folder dropdown combobox.

SetFocusOnFiles
Sets focus on the file ListView

SetPreviewPictureWithHBITMAP
If the Preview Pane is active, manually set what it shows by HBITMAP

SetPreviewPictureWithHICON
Same as above but with HICON

SetPreviewPictureWithStdPic
Same as above but with StdPic object.

SetSelectedItemsEx
Allows selecting files by pattern (e.g. *.exe) and provides expanded options for selections including deselect previous and ensure visible. Can be applied to only files, only folders, or both.

ShellTreeStatus (Get/Let)
If you're using the ShellTreeInLayout option, set/retrieve whether the item is checked.

ShowSecurityZone
Adds a StatusBar panel that shows the Security Zone icon+label for the current locationL Computer, Local Intranet, etc. Both are loaded from Windows. (This is a property, but the desc is blank, so temporarily listing it here.

StartLoadingMarquee
Manually turns on the progress marquee in the combobox.

StopLoadingMarquee
Manually turns off the progress marquee in the combobox.

StatusBarHeight (Get/Let)
Set/Get the current status bar height.

StatusText (Get/Let)
Set/Get the current status bar text.

UpdateStatus
Manually set a status bar message. The difference from the above is the ability to set the 2nd panel (if present).



*Events*

BackgroundKeyDown
KeyDown when the control has focus but none of the controls on it do.

BackgroundKeyUp
KeyUp when the control has focus but none of the controls on it do.

Click
Click on the control background, not on a dropdown/list/button/etc.

ComboCloseUp
When the directory dropdown closes up.

ComboDropdown
When the directory dropdown list opens up.

ComboEditChange
When the text in the directory dropdown edit box changes.

ControlTypeChange
Notifies you of control changes between Files Only, Files+Dir, Dir/Drv Only, and Dir Only + Ctls

CustomColor
Allows you to set the fore- and back- color of any item or subitem. Overrides the regular color setting.

CustomColumnQueryData
Identifies a custom column and the item being set with a return for the desired text and, optionally, image index.

DblClick
Click on the control background, not on a dropdown/list/button/etc.

DebugMessage
Provides your form with a copy of the debug output.

DetailsPaneHeightChanged
Notifies you that the height of the Details Pane has changed.

DirectoryChanged
Fires after a directory change is complete. Note: Do not free the pidl referenced here.

DragStart
Gives file list / key state of a drag operation.

DropFiles
Passes a string array with the files passed on a drop operation.

EnterFocus
Control received focus.

ExitFocus
Control lost focus.

FileCheck
Gives the index, name, and check value of a file when it's check/unchecked

FileClick
Gives a clicked files name, IShellItem reference, and which button clicked it.

FileDetailsWrite
Raised when a file property is written with the Details Pane. Includes file name, property, and new value.

FileExecute
Gives the file name and IShellItem reference of a file when double-clicked or Enter pressed.

FileRenamed
Raised with the old name and new name.

FileSearchPopup
Notifies the host that a search has started, and includes all the details of the search.

FileSearchStart
Notifies the host that a search has started, and includes all the details of the search.

FilterBarOverride
The Filter Bar has its own matching setup, but you can substitute your own using this event.

FilterFile
Allows a custom choice on whether or not to show each file. Will override ItemFilter.

FilterFolder
Same as above for folders. Will override ItemFilterFolder.

FooterButtonClick
Gives the index and lParam of a clicked footer button.

ItemAdded
Raised with the name of an added file.

ItemLinkClick
Raised when a link from a hyperlink column is clicked.

ItemRemoved
Raised with the name of a file that was removed from the list (deleted, moved, etc).

ListKeyDown
Passes the key pressed and provides an option to disable internal handling of it.

ListKeyUp
Notifies when a KeyUp event occurs from the ListView.

MouseDown
Click on the control background, not on a dropdown/list/button/etc.

MouseMove
Same as above.

MouseUp
Same as above.

PreDirectoryChange
Fires immediately before the loading process for a new location begins. Allows cancelling the navigation.

PreviewPaneWidthChanged
Notifies you of a change in the Preview Pane width.

QueryCustomIcon
Supply a custom icon when the view mode is SB_VIEW_CUSTOM.

QueryCustomIconOverlay
Supply a custom overlay icon when the view mode is SB_VIEW_CUSTOM.

QueryCustomInfoTip
Supply a custom infotip (similar to a tooltip) if that option has been selected for InfoTipMode.

SelectionChanged
Provides a string array of all selected items, a string of the focused item, and an IShellItem for the focused item.

SelectionCleared
Raised when the selection changes to nothing selected.

ShowShellTree
If you're using the ShellTreeInLayout option, notifies when the user toggles the menu item for it.

SortItems
Provides various details about each sort operation.

StatusMessage
Provides a copy of any message going to the StatusBar, e.g. in case you don't have it enabled and want to display it elsewhere.

ToggleDetailsPane
Notifies you that the Details Pane has been shown or hidden.

TogglePreviewPane
Notifies you that the Preview Pane has been shown or hidden.

ToggleStatusBar
Notifies you that the StatusBar has been shown or hidden.

ValidateTextNavigate
When editing in the Dropdown is enabled, allows replacing some or all of the text to e.g. implement shortcut keywords.

ViewChanged
Details, Large Icon, Tile, etc.

----------


## MountainMan

Here is how the form looks like when I first run your sample:



and here is what the form looks like when I dragged the bottom right to show more of the form (I also drug the date/time column header to the right to show file date/times):



I am running Windows 10 and have a scaling factor of 175% set. I'll run this on another machine later where the scaling factor is set to 100% and let you know how it looks.

----------


## jpbro

Does this support custom/virtual data sources in any way? That getting file lists not tied to the file system?

I ask because I have a bunch of data with hashed file names stored on the file system, but with virtual links to those files in a database and custom "file names". I'm thinking about implementing something where users can browse the database of links just like explorer, and I'm curious if your demo would be useful for something like that.

Thanks!

----------


## dreammanor

@jpbro: 

I haven't tested fafalone's control, it looks interesting. Maybe the following links are useful to you:

http://www.planet-source-code.com/vb...65746&lngWId=1
http://www.planet-source-code.com/vb...66732&lngWId=1
http://www.planet-source-code.com/vb...67906&lngWId=1

----------


## fafalone

*Reply to Post #3:*
Thanks for the feedback. For #3, you're talking about the View button right (refer to the picture in the main post)... is the option to show the View button enabled, and are you on standard DPI (I haven't checked anything regarding DPI sensitivity yet), and OS version? I'll have to take a more thorough look since as the picture indicates, it appears normally on my system.
With #4, does refreshing fix the issue? I've had to add a couple refreshes for things like that before, it usually works. If not, does changing directories fix it? Or adding/hiding a column? I'll take a look myself of course but additional feedback always helps.





> Here is how the form looks like when I first run your sample:
> 
> 
> 
> and here is what the form looks like when I dragged the bottom right to show more of the form (I also drug the date/time column header to the right to show file date/times):
> 
> 
> 
> I am running Windows 10 and have a scaling factor of 175% set. I'll run this on another machine later where the scaling factor is set to 100% and let you know how it looks.


Ah, definitely a DPI scaling issue then. None of the scaling adjusts for that yet; I'll do it for the next version though, I'm more familiar with it now and it worked out pretty well after making the TaskDialogIndirect project work with different DPI.


*Edit:* Regarding the View switching, can you confirm, the only time a problem arises is when Thumbnail view is activated and then switched out of? Thumbview changes the imagelist and item icon indecies, so to fix it I restored those in the switchout. I have no idea why the details weren't showing in the columns, but calling a refresh after the switchout restores them.




> Does this support custom/virtual data sources in any way? That getting file lists not tied to the file system?
> 
> I ask because I have a bunch of data with hashed file names stored on the file system, but with virtual links to those files in a database and custom "file names". I'm thinking about implementing something where users can browse the database of links just like explorer, and I'm curious if your demo would be useful for something like that.
> 
> Thanks!


I'm not sure there's anything that would benefit over starting from scratch; there's very little in the project that does any manual file handling, it's all back and forth with the shell. I'm not entirely sure the format you mean though; if you just wanted to replace the file system names with one looked up from a database, that would be easy enough, just a couple lines in the enumerator (and would work out well, since the display name is largely unconnected to anything about the file)... if that's not an accurate picture of what you're doing can you clarify?

----------


## jpbro

Hi fafalone,

Sorry for not getting back to you sooner, I missed your reply.

Here's a better explanation of my situation.

I have some called "Projects" and each project has a name (basically a database table).

Each project can have sections, say "A" to "J".

Each section can have items (unlimited, identified by a GUID).

Each item can have attachments (again unlimited, identified by a GUID, a file hash, and with a human readable title).

Attachments are things like PDF and image files. They are stored on the file system in a series of subfolders based on the first 4 characters of their file hash. A single attachment can be linked to multiple items across multiple sections and projects, but it will only be stored on the file system once and only a link is recorded in the project database.

So what I would like to do is have a browsable shell/explorer-like interface that let's users pick a project and it will show all of the attachments for that project. Columns might be SECTION, ITEM, TITLE, SIZE, FILETYPE, PHYSICAL LOCATION, HASH. Physical locations can of course then be duplicated across multiple attachments as long as the linked item is different.

So a file with a hash of ABCDEFGHIJKLMNOP would be stored somewhere C:\ProgramData\MyApp\Attachments\A\B\C\D\ABCDEFGHIJKLMNOP, but it is linked in project A, Section 2, Item QRSTLMN as well as Project A, Section 4, OPQRSTU. I would like to show both entries but customize the text that appears for all column/cells to the friendly human readable forms.

Would such a thing be possible with your demo? I'm willing to do the work to modify it, just wondering if I should even bother to try. 

Thanks!

----------


## fafalone

Ok so I think I understand how you would want this to work... you would be able to generate a list of shell locations (full file paths) for the current items attachments, then you just want to display those in the ListView? And since it's a fixed list, you wouldn't need navigation ability right?

If that's an accurate assessment of the functionality, then to load an arbitrary list of files in different locations like that, I don't think starting with this project would be the best route to go. However, another project of mine, Advanced Thumbnail ListView, could very easily be modified to show such a list-- despite the project being about thumbnails, before thumbnail mode is activated, it loads a file system folder with normal icons that you could change to most of the other views without effort. The enumeration method in that project would be able to be modified to load an arbitrary list instead quite easily, and would be much easier to have a fixed, custom set of details columns (set just like the first column but with the .iSubItem filled in). Then, taking any other Explorer-type functionality you might need could be transplanted from this project (like if you wanted the right-click context menu from Explorer, the preview pane, or the drag and drop features, etc). I really think going that direction would be more efficient than re-doing the loading/navigation/details system in this project, because it's so thoroughly bound to the shell.


*Edit: General Update on 2018-01-17*
Haven't stopped developing this project, it's just very complicated to add the latest set of features... added over 2,000 lines to the project since the first release 
_New:_ Details pane (multi-item, background, read/write strings), Active drag/drop, disable d/d option, browse in Zip, add/remove/update file list in response to shell change notify*, resize preview pane, autotoggle control box at small widths, all reported and several unreported bugfixes
At this point, the next version is feature-complete; going to hold over detail pane editing for non-string and tree updating (see note below) for a future version. 
All that remains is final testing. Surprisingly no adjustments needed to be made for DPI.
*-The tree dropdown isn't updated; this would require monitoring the entire filesystem and be much more trouble than it's worth

----------


## jpbro

Hi fafalone, thanks for you thoughts on this, I appreciate it! I will give it a try with your Thumbnail view project as soon as I can.

----------


## fafalone

v2 is feature-complete, so I thought I'd post it as a beta release for anyone else interested to test too.

*
Test Updates*
Glad I didn't post this as a final...
-FileDragDropMode Property Let has an error, Detach shouldn't have an argument.
-Subclassing the edit boxes for properties seems to be stable, so I'm going to go that way after all. That means the Save/Cancel buttons will automatically appear without the need of clicking a picture, when you type a char
-Since it's subclassed now, going to include the ability to change dates too, popping up a datetime control on click, presuming it saves ok when I get to that part (working with PROPVARIANT is a pain to begin with, VT_FILETIME being unsupported without PropVariantToVariant doubly so; that works for reading it, hopefully I can get it to save). *Edit*: Confirmed working! Used InitPropVariantFromFileTime.
-Like the Date Control above, there's also pop-up combobox controls for editable properties that are a list.

Just getting the list items is crazy:


```
                            If tDispProps(nDispProp).dwDispType = PDDT_ENUMERATED Then
                                On Error GoTo e1
                                DebugAppend .szSystemName & " type=0x" & Hex$(tDispProps(nDispProp).dwDispType)
                                pps.GetValue .pkey, vrp
                                PropVariantToVariant vrp, vrpvb
                                DebugAppend "Value=" & CStr(vrpvb)
                                tDispProps(nDispProp).vEnumeratedValue = vrpvb
                                DebugAppend "VarType=" & VarType(vrpvb)
                                If VarType(vrpvb) = vbEmpty Then
                                    tDispProps(nDispProp).vEnumeratedIsEmpty = True
                                End If
                                    
    '                            GoTo skipenum
                                Dim ppd As IPropertyDescription
                                PSGetPropertyDescription .pkey, IID_IPropertyDescription, ppd
                                Dim pETL As IPropertyEnumTypeList
                                Dim pET As IPropertyEnumType
                                Dim nEnumType As PROPENUMTYPE
                                Dim lpInitIdx As Long
                                Dim nTCt As Long
                                Dim vr1 As Variant, vr2 As Variant, vr3 As Variant, vr4 As Variant
                                Dim vb1 As Variant, vb2 As Variant, vb3 As Variant, vb4 As Variant
                                Dim lpTemp As Long, sTemp As String, l1 As Long, l2 As Long, s1 As String, s2 As String
                                ppd.GetEnumTypeList IID_IPropertyEnumTypeList, pETL
                                If (pETL Is Nothing) = False Then
                                    DebugAppend "Got ETL for " & .szSystemName
                                    pETL.GetCount nTCt
                                    If nTCt > 0 Then
                                    DebugAppend "typect=" & nTCt
                                    ReDim tDispProps(nDispProp).sEnumerated(nTCt - 1)
                                    ReDim tDispProps(nDispProp).vEnumerated(nTCt - 1)
                                    For j = 0 To (nTCt - 1)
                                        pETL.GetAt j, IID_IPropertyEnumType, pET
                                        If (pET Is Nothing) = False Then
                                             pET.GetEnumType nEnumType
                                            DebugAppend "nEnumType=" & nEnumType
                                            If nEnumType = PET_DEFAULTVALUE Then
                                                pET.GetDisplayText lpTemp
                                                DebugAppend "PET_DEFAULTVALUE str=" & LPWSTRtoStr(lpTemp)
                                            End If
                                            If (nEnumType = PET_DISCRETEVALUE) Then
                                                pET.GetRangeMinValue vr1
                                                pET.GetRangeSetValue vr2
                                                PropVariantToVariant vr1, vb1
                                                PropVariantToVariant vr2, vb2
                                                DebugAppend "PET_DISCRETEVALUE v1=" & CStr(vb1) & ",v2=" & CStr(vb2)
                                                pET.GetValue vr3
                                                 
                                                PropVariantToVariant vr3, vb3
                                                DebugAppend "PET_DISCRETEVALUE vr3=" & CStr(vb3)
                                                pET.GetDisplayText lpTemp
                                                tDispProps(nDispProp).sEnumerated(j) = LPWSTRtoStr(lpTemp)
                                                tDispProps(nDispProp).vEnumerated(j) = vr3
                                                DebugAppend "PET_DISCRETEVALUE str=" & tDispProps(nDispProp).sEnumerated(j)
                                                If tDispProps(nDispProp).vEnumeratedIsEmpty = False Then
                                                    DebugAppend "Comp " & CLng(tDispProps(nDispProp).vEnumeratedValue) & "|" & CLng(vb1)
                                                    If CLng(tDispProps(nDispProp).vEnumeratedValue) = CLng(vb3) Then
                                                        tDispProps(nDispProp).lEnumeratedInitialIndex = j
                                                    End If
                                                End If
                                            End If
                                            If (nEnumType = PET_RANGEDVALUE) Then
                                                pET.GetRangeMinValue vr1
                                                pET.GetRangeSetValue vr2
                                                PropVariantToVariant vr1, vb1
                                                PropVariantToVariant vr2, vb2
                                                DebugAppend "PET_RANGEDVALUE v1=" & CStr(vb1) & ",v2=" & CStr(vb2)
                                                pET.GetDisplayText lpTemp
                                                tDispProps(nDispProp).sEnumerated(j) = LPWSTRtoStr(lpTemp)
                                                If CLng(vb2) = 0& Then
                                                    tDispProps(nDispProp).vEnumerated(j) = vr1
                                                Else
                                                    tDispProps(nDispProp).vEnumerated(j) = vr2
                                                End If
                                                tDispProps(nDispProp).vEnumeratedIsRanged = True
                                                DebugAppend "PET_RANGEDVALUE str=" & tDispProps(nDispProp).sEnumerated(j)
                                                If tDispProps(nDispProp).vEnumeratedIsEmpty = False Then
                                                    If CLng(tDispProps(nDispProp).vEnumeratedValue) >= CLng(vb1) Then
                                                        tDispProps(nDispProp).lEnumeratedInitialIndex = j
                                                    End If
                                                End If
                                            End If
                                            If nEnumType = PET_ENDRANGE Then
                                                pET.GetValue vr3
                                                pET.GetRangeMinValue vr4
                                                PropVariantToVariant vr3, vb3
                                                PropVariantToVariant vr4, vb4
                                                DebugAppend "PET_ENDRANGE v3=" & CStr(vb3) & ",v4=" & CStr(vb4)
                                                tDispProps(nDispProp).vEnumeratedEndRange = vr3
                                            End If
                                        End If
                                    Next j
                                Else
                                    DebugAppend "typect=0"
                                End If
                            End If
                        End If
```

*Update* (Jan31)
Removed beta; full release imminent. Sorry for the delay but I just couldn't resist finishing up the property editing. All that's left is running through everything to check for bugs.

----------


## fafalone

*ucShellBrowse Version 2 has been released.*


*New Key Features*
-Explorer-style Details Pane: It pulls the same list of 'preview properties' to display at the bottom, which vary by file type. For some file types, Explorer lets you edit certain properties-- this project does as well, including popping up date and combo controls. The number of properties that can fit are adjusted based on size. Rows can add with vertical height but it's not sizable at runtime yet (UPDATE: Now is in latest version). As a finishing touch, the "edit invitation" cue banner for blank but editable fields is also included (e.g. "Add tag"). 

-Dynamic Drag Drop: As you drag over items in the list, folders and zip files are highlighted as you drag over them, and can be dropped on directly. This can be done fully internally as well. 

-Directory Updates: The control monitors the current directory for files added, deleted, or updated, and then updates the ListView.

-Sizable Preview Pane: Per request, this is now sizable. Right click the frame caption to select 'Lock width' to determine which control is changed on horizontal resize. (UPDATE: Draggable size bar now present in latest version; Lock width disables it)

-A number of minor features have also been added, as well as a host of bug fixes. See the full changelog below (or in ucShellBrowse.ctl) for details.

A couple more shots of the new detail panes editing ability, popup controls like Explorer:




Here's the full changelog:


```
'------------------------------CHANGELOG------------------------------
'v2
'-The Details Pane is now available. It displays what Explorer would. Editing
' values is supported, now for all types (string, number, datetime, list) except
' boolean, which does not appear to be used (if you find where it is, let me know)
'-Added active drag/drop: folders (and zip files) are highlighted as items are
' dragged over them, and can be dropped on directly
'-Active drag/drop allows internal drag/drop as well
'-Added option to disable drag, drop, or both
'-Added option to browse inside zip/cab files (on by default)
'-Current folder is monitored for changes (new item, deletion, update). On by default
'-A splitter bar was impractically complex, but you can now have either the ListView
' or the Preview frame size horizontally-- right click the "Preview" text in the frame
' to set the 'Lock width' option
'-If the control box is on (Back,Up,View) and the width gets so small the directory
' dropdown would disappear, the control box is automatically switched off, then restored
' when the width becomes wide enough again
'-Added option LockNavigation that prevents the user from changing directories. The path
' can still be changed in code with .BrowserPath.
'(Bug fix) Switching from thumbnail view to other views resulted in loss of icons
'          and/or detail column text
'(Bug fix) Command box buttons were cut off in different DPI
'(Bug fix) Combo overlapped top of ListView with different DPI
'(Bug fix) Preview pane and ListView height for different DPI
'(Bug fix) View button icon was different in Win10; now just stored internally
'(Bug fix) Navigation couldn't handle certain functionality in the Fonts folder
'(Bug fix) Crash occured after mouseover of shell context menu seperators with id -1
'(Bug fix) Clicks/double clicks on statusbar were interpreted as clicks on the ListView,
'          click events changed to verify origin hWnd now
'(Bug fix) At certain control widths a background image holder control was mistakenly visible
'(Bug fix) If multiselect was enabled and your selection drag finished outside an item, item 0
'          was set as the focused item (main selection) even if it wasn't selected. If that
'          happens now, the first item in the multiselect group (or the real selected item when
'          it's the only selected item) is reported as the single selection result
'(Bug fix) If you clicked on a control box button (Back,Up,View) then clicked on the ListView again,
'          keystrokes were sent to the buttons instead of the ListView
'==============================
```

I checked it on high DPI (simulated on a Win8 VM with scale 150%) and everything seems to render and size correctly, which was a little surprising for the details pane since there's loads of manual pixel count calculations... so if there's an issue let me know (and if you want to play with it yourself remember the current scale factors are stored in m_ScaleX/m_ScaleY).

----------


## fafalone

*ucShellBrowse v3 - Beta Version*

Version 3 of ucShellBrowse includes a few new features and some critical bug fixes. There's now standard resizing (which can be toggled on/off) between the ListView and the optional Preview/Detail panes. Also, there was a ControlType option listed, but no other modes were implemented. Now they are, and a 'Drives Only' mode has been added; this finalizes being a complete replacement for the VB (Drive|Dir|File)ListBox controls.

It is entering the final testing phase, and posting it makes sense since I'm particularly concerned about DPI on different peoples systems, as there's a number of changes to sizing routines revolving around finally just making the Preview Pane and Details Pane be resizable via a traditional drag bar between them and the ListView. Please report any bugs relating to that or anything else.

Full Change Log:


```
'v3
'-Alternate modes for ControlType are now available; control can be Directory Only,
' Drives Only, or Files Only, showing only the combo or ListView, in addition to the
' normal mode of dir+files with both controls.
'-Detail Pane can now be sized with a bar; this also includes correctly scaling
' the icons. The height is 70 by default.
'-The Preview Pane now also uses a resize bar.
'-The Lock Width|Height menus for the panes are still present, and now serve to remove
' the sizing bars. Both sizing bars are active by default.
'-Panes are now redrawn automatically when resized
'-Property columns on the Details Pane will now be widened if there's room.
'-Automatically make a single column match the listview width on startup
'-(Bug fix) After dropping on a folder or zip file, the hilite didn't clear when
'           another item was clicked or it was deselected
'-(Bug fix) Dropping on libraries wasn't working; now works for both background and
'           dynamic dragdrop
'-(Bug fix) When on the Desktop, any file created/deleted anywhere was added/removed
'           from the list
'-(Bug fix) The column right-click menu default properties (name,size,etc) were hard
'           coded instead of using the language of the system; now only the 'More..'
'           item remains non-localized.
```


*
UPDATE*
FIX RELEASED
Both this version and the previous version of ucShellBrowse contain the code (ppcp.IsPropertyWritable(VarPtr(.pkey)) <> S_OK), but the current release version of oleexp.tlb has this as a Sub (and it cannot work that way). I don't understand why no one seems to have encountered this error before this beta.
It also fixes the two similar typelib-version based errors Steve pointed out below. Apologies for forgetting the version difference.

*UPDATE 2*
I've finalized oleexp v4.4, please upgrade in order to use the latest version of ucShellBrowse.

(Version 3 has been officially released, so the beta version has been removed. Thanks everyone who tried it out early!)

----------


## Steve Grant

Hi fafalone, I always enjoy testing your stuff but this latest demo (V3) has me beat!

No problems with references (4.3 is used), but ran into;

Getsystemmetrics remarked out
SM_CXICON not declared
ppcp.IsPropertyWritable(VarPtr(.pkey)  Byref argument type mismatch

Win 10 64 16299.309 VB6 Pro SP6.

----------


## fafalone

Sorry about that, the first two I forgot to define in module; the next version of oleexp.tlb has them defined in the typelib.

.IsPropertyWritable on the other hand, I thought was similar but has me thoroughly confused. That line has not changed since the previous version, and it's a show-stopping error, but it's not come up before? The details pane is on in V2 by default and as soon as you click a file that error pops up. Only thing I can think of is no one ran the V2r1 Demo project and never turned it on in their projects. Was this the case for you (assuming you used the prev. version at all)?

Going to have to investigate this further... in the mean time, I'm putting a copy of the latest dev build of oleexp.tlb in the zip; there's no changes to existing interfaces besides the .IsPropertyWritable, so it's safe to replace. _See below.
_
*Update*
There's no getting around needing that to be a function; I've finalized and released oleexp.tlb 4.4, so that's going to have to be updated to use v3 (and apparently v2).

----------


## Steve Grant

This is my first time with ucShellBrowse. However if you would like me to test the earlier versions I will.

----------


## fafalone

Definitely appreciate the offer but it's moot now with the new tlb out. Onwards and upwards!  :Smilie:

----------


## fafalone

*Version 3 Officially Released!
*
Everything appears to be ok on high DPI systems from my testing, and that was the final delay. A number of features have been added since the initial beta, so you'll want to grab the new release even if you downloaded that. 

The biggest changes are a Bookmarks button, new control modes (the ones that were listed but weren't implemented, along with a new 'Drives Only' mode), draggable sizer bars for the preview and details panes, and a checkboxes option. Beyond that there's lots of little features, improvements, and bug fixes-- definitely worth upgrading. 
Here's the full list of changes:


```
'v3
'NOTE: If you had moved the functions from mSBSubclass, be advised this version adds
'      one more wndproc, DthWndProc.
'-Added an optional Bookmarks button in the control box (hidden by default). Note that
' the entries are stored in the system registry, under ucShellBrowse (UserControl.Name)
' in the VB programs section. See the variable in the section just below this readme to
' set the max number of entries (initial default = 48)
'-Alternate modes for ControlType are now available; control can be Directory Only,
' Drives Only, or Files Only, showing only the combo or ListView, in addition to the
' normal mode of dir+files with both controls.
'-Added option to select files by using checkboxes (off by default).
'-Detail Pane can now be sized with a bar; this also includes correctly scaling
' the icons. The height is 70 by default.
'-The Preview Pane now also uses a resize bar.
'-The Lock Width|Height menus for the panes are still present, and now serve to remove
' the sizing bars. Both sizing bars are active by default.
'-Panes are now redrawn automatically when resized
'-Property columns on the Details Pane will now be widened if there's room.
'-Automatically make a single column match the listview width on startup
'-Added SelectedFile/SelectedFiles property get/let to retrieve just the filename, and
' the let allows changing the selected item(s) to the given name(s)
' NOTE: Since Property Lets cannot accept an array directly, SelectedFiles uses a
'       Variant to hold the (string) array (applies to the Get as well since they must
'       use the same type).
'-Added some additional UserControl event forwards (mouse actions, these only apply to
' the small background areas of the UC, not the controls on it)
'-Added ItemAdded/ItemRemoved event for changes in the currently displayed folder (does
' not fire during the location changing)
'-Added FileDetailsWrite event for when file metadata is written from the Details Pane
'-Added StatusMessage event that fires when the control updates its status message
'-Added Files() and Folders() function to get a list of *all* files/folders instead of
' just the selected ones, also FilesFullParsing/FoldersFullParsing to supply a list of
' full paths/filenames with the absolute names (SIGDN_DESKTOPABSOLUTEPARSING). Whether
' ZIP files are counted as files or folders is controlled by whether the BrowseZip option
' is enabled or not-- if it's treated as a folder it's counted as one.
'-Added additional sizing restrictions to prevent elements from being sized to 0
'-(Bug fix) The file name caption in the Details Pane used a standard label, so could
'           not display Unicode. It has been replaced with an API-created label to allow
'           tbat. Additionally, the label uses the system default caption font.
'-(Bug fix) After dropping on a folder or zip file, the hilite didn't clear when
'           another item was clicked or it was deselected
'-(Bug fix) Dropping on libraries wasn't working; now works for both background and
'           dynamic dragdrop
'-(Bug fix) When on the Desktop, any file created/deleted anywhere was added/removed
'           from the list
'-(Bug fix) The column right-click menu default properties (name,size,etc) were hard
'           coded instead of using the language of the system; now only the 'More..'
'           item remains non-localized.
'-(Bug fix) The Preview Pane may have overlapped the Details Pane when the height was
'           below a certain point.
'-(Bug fix) When changing control properties in the IDE, the PreviewPane property would
'           get stuck in the True position.
'-(Bug fix) When changing the ListControlBox property, the path combobox didn't adjust
'           to not overlap it. It now does in both design time and run time.
```


And to look ahead, it's not in this version since it requires an upgrade to oleexp (or would require a whole other typelib), and I just released one, but...
Coming soon to a ucShellBrowse near you:

----------


## MountainMan

Fafalone,

Your instructions for using the .ctl version says "your project must contain mSBSubclass.bas (from the main folder of the project)" and I don't find that file in either the demo project or in the files for v4.4 of oleexp. Am I missing something?

----------


## fafalone

mSBSubclass was in the root folder along with the .ctl.... BUT, there's now a huge update and it's no longer required with the new version.

*Version 4 Has Been Released!*
This is the largest update since the project began, with 23 new or enhanced features and 18 bug fixes, and the control now uses Paul Caton and LaVolpe's self-subclass/self-callback thunks (modified to handle the large proc count) so the subclassing .bas is no longer needed. There's an optional graphics/manifest resource file included: It enables replacing the menu images with higher quality transparent icons (this is automatic, no additional code needed and if the .res isn't present the control falls back to the originals); and also a Common Controls 6 manifest, which you can delete if you've already got one but want the icons. An additional demo project is included that shows minimalist use of the control, similar to the original folder/file list VB controls. Most important for that is the new HideColumnHeader option, which lets you keep the control in Details view so the scrolling is vertical instead of horizontal like the other small icon views, without the big ugly header saying Name.

*IMPORTANT:* This version requires an update to oleexp.tlb as well, to version 4.42, released concurrently with this project (April 13th).

Here's a pic of the new footer, as well as Explorer-style infotips that display different properties as a tooltip, the properties chosen based on filetype (the ones from PKEY_PropList_InfoTip). Also shows the full name if it's wrapped ('...'). 

And also, various new features (and a new demo) to make minimalist usage better:

Your control can be configured to be like the first pic, the second, and everything in between.Full list of changes:


```
'v4
'(Code/Control) mSBSubclass is no longer needed. All subclassing/callbacks are now
'               done with Paul Caton/LaVolpe's Self-Subclass/Callback code.
'               Special thanks to LaVolpe and Victor Bravo VI for helping me on that.
'
'-A footer control can now be added to the view. Be advised this is done
' using undocumented interfaces and messages; it works as of the latest
' version of Windows 10 at the time of this release, and back to Vista.
'
' The calls are FooterCreate, FooterAddButton (to add another one after the initial
' set), FooterClearButtons (not possible to remove a single one), and FooterRemove.
' It's recommended to use the lParam to store a unique identifier, but both that and
' the button index are passed in the FooterButtonClick event that's raised on click.
' The number of buttons is limited only by practical space.
'
' You have two options for footer icons:
' 1) Create an API ImageList (or IImageList then ObjPtr() to it), and pass an array of
'    Long with the index for each item as the tButtonIcons argument.
' 2) If you have a resource file, add the .ico files to it as a 'CUSTOM' resource, with
'    a name in quotations, e.g. "ICO_FOOTER1". The icons can be 32bit alpha icons or any
'    other ICO file type. The control will then create the ImageList itsself... pass 0&
'    as the value of hImageList, then pass a String array with the resource name for each
'    item as the argument for tButtonIcons.
' See the Demo project for code showing both approaches.
'
'-Hovering over an item now shows an InfoTip like Explorer; a multiline tooltip with the
' full file name (only if the label is truncated), then several properties depending on
' file type and whether the property is blank or not.
'
'-The columns are more like Explorer several ways; in special folders, like Computer,
' Fonts, and Network, only the limited cols that are shown in Explorer are listed (and are
' added to the right-click column menu if there's only a few of them). Columns added
' recently are now listed (if available in the current folder).
'
'-There's a resource file in the ucShellBrowse folder, resImages.res, that you can add
' to the control or to a project with the CTL (the Demo has it now) to make the icons
' on the View menu transparent, and add a few more icons. There was no way to do this
' without an extra file. If you do not add the resource file, the old icons with the
' slightly off-color background are still present and are loaded instead. You can also
' use this resource file to add icons for the footer (see above).
'
'-Additional options have been added to give you more control over the runtime:
'  EnablePreview - Show/hide Preview Pane from the View menu (keeps it locked to design
'                   time setting)
'  EnableDetails - Same for Details Pane
'  EnableViewMenu - Toggles whether the View menu pops up for LV background right-click
'  LockView - Keeps the design-time view (Details, Large Icons, etc) by hiding menu options
'  HideColumnHeader - Show/hide the column header in Details view.
'  MinDroppedWidth - Set a minimum width for the ComboBox; useful for simple modes.
'-Properties to get the major control hWnds also added: hWndCombo and hWndListView
'
'-Previews are now centered in the frame instead of in the top left
'
'-You can now manually set an image in the Preview Pane, there's subs SetPreviewPicture
' and then StdPic, hBitmap, and hIcon.
'
'-The width of the preview pane, and height of the details pane, now have a get/let
'
'-Tile View now shows 3 details instead of 2; type, size, and date modified
' property. The preview height/detail width are Get only; adjust the control itself
' to change the other dimension.
'
'-The column menu popup (when right-clicking the column header), recently used columns
' that have been removed are now listed.
'
'-The Status Bar now shows the number of files that are selected.
'
'-On the Details Pane, properties can't be edited on a read-only file even if the prop is
' normally able to be edited-- in this situation empty properties are no longer displayed.
'
'-The items listed in the columns checklist included many that were unsupported in Explorer;
' they're now limited to supported columns (i.e. the same set you see in Explorer).
'
'-For the 'More...' columns popup frame, it now increases in height if the main ListView
' height is large enough. Also, it's no longer clipped by the UserControl being shrunk while
' it's visible, it will be on top of the host form (and will be clipped by total form height).
'
'-Added shortcut to de-select all items when Escape is pressed (and ListView has focus).

'-Alt+Enter on the ListView will now display properties of the selected items (or the current
' folder if nothing is selected).
'
'-Shift+Delete has been added as a shortcut to permanently delete files (no Recycle Bin).
'
'-Added event for debug message; logging to file will not be added to this control, so
' this allows for it to be implemented by the host project.
'
'-Back button is now disabled when there's no further previous locations.
'
'-The 'Up' button is now disabled when the root is reached (Desktop, or Computer if
' using the 'ComputerAsRoot' option).
'
'-Extended columns that are dates or numbers are now sorted as such (instead of plain text),
' however the number sorting is currently imperfect as it takes the Val() of the text, in
' the future this will be changed to compare the raw numbers (not easy to set up).
'
'-Added StatusSinglePanel option to only show the first panel of the StatusBar; mainly for
' when the control width is small.
'
'(Bug fix) If the Details Pane was turned on via code at runtime, it came up blank until
'          something was clicked. Now, it renders the background view (folder icon+count)
'
'(Bug fix) In Tile View mode, if a new file is created and added (i.e. not part of the
'          list when tile view was activated), including switching dirs, the extra lines
'          were not displayed.
'
'(Bug fix) When new items are added via shell notify, details (column subitems) were not
'          loaded, despite the fact the normal property enumerator function was called. This
'          was fixed, oddly enough, by simply calling it twice.
'
'(Bug fix) For some reason, if a button in the control box had focus when a new folder was
'          created, all keys went to the name label... *except* enter... so you'd type a new
'          name, hit enter, then the View menu would pop up, or the control would navigate to
'          Up or Back. The new name was still applied when the label edit ended.
'
'(Bug fix) Sort Ascending/Sort Descending menu options on the view menu had not yet been
'          implemented (though clicking the column to change sort direction was).
'
'(Bug fix) The initial ViewMode property was stuck on 1 - Details due to that mode entirely
'          breaking if column initialization didn't run while it was on. I don't understand
'          why the behavior is different versus loading a new directory while in non-details
'          mode, and haven't been able to identify a direct fix, so it was locked. But this
'          version adds an indirect workaround-- temporarily switching to Details, running the
'          default column init, then switching back before items are added; allowing it to
'          work as expected. All View Modes, including Tile and Thumbnail, can now be chosen
'          as the initial view, without breaking the display of any other mode switched into
'          during runtime.
'
'(Bug fix) When 'Keep same columns' option was enabled, only columns present when enabled would
'          be remembered, forgetting any columns added to the current view afterwards. Now, the
'          current column set is retained as displayed at the time of the switch.
'
'(Bug fix) When adding additional columns from the checklist, if more than one was selected, only
'          one of the details would be filled in until the folder was refreshed or changed.
'
'(Bug fix) On the Details Pane, the mouse cursor no longer changes when over properties that can't
'          be modified. The text box was still read-only, but this clears up the visual confusion.
'
'(Bug fix) 'Computer As Root' mode still loaded the Desktop when you clicked Computer in the combo.
'
'(Bug fix) Sorting by date accessed or date created wasn't working.
'
'(Bug fix) Sorting by extended columns required 2 clicks because the column index lagged one behind.
'
'(Bug fix) File name colors (blue for compressed, green for encrypted) stopped working sometime
'          between version 1 and this one.
'
'(Bug fix) Renaming files in response to shell notifications deleted and re-added, resulting in the
'          property fields turning blank. Now there's a proper rename that just updates the item, so
'          the properties stay filled.
'
'(Bug fix) The control uses a few common types, like RECT, POINT, and SIZE, that are defined in
' (code)   oleexp.tlb. If these were publicly defined in your project, the priority would be higher
'          and you'd get Type Mismatch errors. The generic types have been explicitly changed to
'          'As oleexp.RECT' etc. A private type wouldn't have worked without more trouble; can't
'          pass them to tlb interfaces. Less common types and APIs were also preemptively changed
'          to explicit calls just to prevent potential conflicts; e.g. API is different or takes
'          an oleexp type; these would error if conflicted with a Public Declare.
'
'(Bug fix) Setting the mode to Files Only then changing it back to Dir+Files caused ListControlBox
'          to get switched off and stick a little.
'
'(Bug fix) In Dir Only or Drives Only mode, there was an artifact from the Status Bar if it was enabled,
'          and since that's the default, it's now hidden in those modes regardless of ShowStatusBar.
'
'(Bug fix) In Files Only mode, the top of the ListView was not the top of the control, resulting in the
'          status bar being overlapped if it was visible, and the blank space at the top of the control.
```

----------


## MountainMan

First demo won't compile. Error "User-defined type not defined" on line 434 in ucShellBrowse.ctl. The offending line is:



```
Private pLVF As IListViewFooter
```

Second demo won't compile either. Error is "Variable not defined" with MAX_PATH being highlighted in line 1503 of ucShellBrowse.ctl:



```
  szDisplayName As String * MAX_PATH
```

I know what MAX_PATH is but somewhere your demo is expecting to find it in the code you posted but it isn't there...

----------


## fafalone

The new version requires an update to oleexp (to version 4.42, just released for this) because of the interface needed for the footer bar. It was in another tlb but I merged it into oleexp so as to not add an additional tlb depend. I noted it in the first post but I'll add it to the release post as well, sorry for not making that more clear.

But I'm not sure why MAX_PATH would be undefined; that's been included in oleexp for a long time now (since 2015's v3.2), and the line in question has been present and unchanged since the very first release of ucShellBrowse (along with many other instances of it, always relying on the tlb). If it's still an issue after 4.42 let me know; I'll try to figure it out... I did test compile on my native Win7 and the Win8 VM that's a clean test platform with just the files posted, without any such issue.

----------


## MountainMan

I have previously downloaded v4.4 and the demos did not compile. I have now downloaded v4.42 and everything works well. Thank you.

----------


## fafalone

*ucShellBrowse v4.1 has been released*

This is a minor update that has important fixes for Unicode support. Also, the dependency on mscomctl.ocx (Microsoft Windows Common Controls) has been removed, as the 2 controls that were using it are also done entirely in API now. The lag surrounding selecting/deselecting large numbers of items has also been addressed.



```
'v4 Rev 1
'
'(Code/Control) The reference to Windows Common Controls 6.0 (MSCOMCTL.OCX) has been
'               removed. They were used for the StatusBar and Column Selection list;
'               these are now created entirely with API. This leaves oleexp as the
'               only outside dependency.
'
'-Removed delays when selecting/deselecting large numbers of items. Each change was
' being rendered to the Details Pane, which could cause several seconds of visible
' refreshing. Now, when an item changes, a timer is set, so that any more items
' selected in the next few milliseconds is included in a single update. See the
' nSelUpdateMillisecs constant in the section below these comments to adjust.
'
'-When a new folder is loaded, focus is now automatically set to the files list.
'
'-Added option to hide labels (file names). This doesn't impact any operations, just
' display. Useful for e.g. just showing thumbnails without filenames in the way.
'
'(Bug fix) Rename-in-place did not support renaming files with extended Unicode
'          characters; after also adding support to valid name checking from paste
'          and several more issues, it's now fully supported-- you can rename and
'          type, paste, delete, etc, with the full set of characters.
'
'(Bug fix) When Details Pane fields were saved, Unicode characters were replaced with
'          question marks. This effects v4 but not v3/v2.
'
'(Bug fix) Sometimes when files are pasted, if they have a custom icon (like a .exe
'          or .ico), only the generic file icon was shown.
```

----------


## fafalone

*Version 4.2 Released*

Nobody noticed the rather severe bug that the directory dropdown was not changing???  :Blush:  :Blush:  I'm so sorry I didn't notice it earlier; put in a last minute change to try to speed usage by setting focus after loading a new directory, and for some inexplicable reason VB insists on waiting for all code to run, even with doevents, and then changing it, which for some reason the focus change prevents.
(If you want to just fix this yourself in the current version, at the end of LVLoadFolder, comment out the two lines SetFocus UserControl.hwnd and SetFocus hLVS)

But anyway, there's a couple other new features that were ready too. Browsing is now able to handle the Recycle Bin and Recent Places (the latter needing special handling). Details Pane shows icon/info correctly in ZIP/CAB now.

----------


## fafalone

*Version 5.0 Released*
This is a major update with tons of new features. 
Some of the highlights:
Custom folders: You can specify a list of files from anywhere on the system and display them together in a single folder.Graphics options: You can now add a background image (in a position or tiled), change the background color, change the foreground (font) color, and change the font.Groups can now be collapsed and subsetted.High DPI scaling is now supported. 

The release zip contains 4 different demo projects:
\Demo - The standard project demo, with the color changes shown above (you can change them back in the regular design mode on Form1)
\Demo2 - Minimalist options that mimic the original VB Directory and Files control.
\Demo3 - The two-control setup pictured in post #2 where you use two different ucShellBrowse controls for an alternative layout.
\DemoEx - Full-sized browser setup working with ucShellTree. NOTE: Requires ucShellTree which is downloaded separately - Get it here, then put \ucShellTree next to \ucShellBrowse



_Custom font, tiled background, and no border._


_Ratings stars, subsetted groups, custom foreground and background colors_


_Automatically populated Special Folders submenu for the Bookmarks menu._

*Version 5.0 Changelog*


```
'v5 (Released 16 Nov 2018)
'-Can display a custom set of files from anywhere on the system. Call the method
' CreateCustomFolder with a list of full paths and other options. Shell context
' menus won't work with multiple files (will execute on focused item), but some
' custom handlers have been added, and it works normally for a single file.
' nIcon can be left as 0 for a standard folder icon, -1 for a search folder icon,
' or any icon index in the system imagelist.
'
'-Control now fully supports high DPI scaling. This requires the dpiAware=True
' value in the manifest. The default manifest, resImages.res, includes that
' setting, but if you want to disable it, resImages-NoDpiAware.res is identical
' except for that setting, and can be readily swapped into this project instead.
'
'-If the 'Rating' column is loaded in Details View, either as a default column
' or selected from the column list, the rating will now appear as a series of
' stars that you can manipulate just like Explorer. Fully supports groups.
' NOTE: This requires the PNG_RT* images in the resource file.
'
'-Additional checks were added before renaming files. This catches errors not
' caught by watching keys, like reserved filenames, invalid filenames made of
' valid characters, and overall path being too long.
'
'-Some virtual folders, like Network Connections for example, have a custom set of
' columns that are not part of the regular property system, so previously could
' not be loaded. They're now viewable through some custom handling.
' This routine also exposes custom columns in virtual folders like 'Network' where
' prior versions could only show the columns that were standard.
'
'-Added a 'Special folders' submenu on the Bookmarks menu containing a number of
' common special folders. You can adjust/add/remove the ones you want in the
' GenerateSpecialFolderMenu/GetSpecialFolderMenuItem methods. Virtual folders are
' supported.
'
'-Added the Bookmarks menu to the View Menu when showed from a folder background
' right click. This is still controlled by the Bookmark Button property, so the
' submenu is only added if the button is (or would be) visible. This allows the use
' of bookmarks without the List Control Box or in Files Only Mode.
'
'-The font for the ListView/Combo/Status can now be changed. (Borrowed from Krool's
' ListView. Thanks!)
'
'-Added CustomColor event, which allows you to set a custom font color and background
' color on an individual item and subitem basis. The file index and file name are sent,
' along with the column index and the system name of the property it's displaying --
' e.g. if the 1st column after the name is size, SubItemIndex=1 and SubItemProp="System.Size"
'
'-Better support for drag-out of virtual objects that can have shortcuts created.
'
'-Added property to control whether sorting is allowed or not.
'
'-Added option to disable Wow64 file system redirection.
'
'-Added ExplorerStyle option to toggle visual styles (defaults to Explorer Theme)
'
'-Added SnapToGrid option. This only applies in icon / small icon / tile views.
'
'-Added HeaderDragDrop option.
'
'-Added TrackSelect option (the selected item follows the mouse pointer).
'
'-Added BorderStyle select with None, Standard, Thick, and Thicker options for the LV.
'
'-Added property SelectedColumn (for runtime only, won't appear in Properties design box).
'
'-Added additional methods to get file info: FileCount, FolderCount, FilePathFromPos and
' FileItemFromPos (which returns a files IShellItem).
'
'-You can now set a background image for the file browser ListView. There are 3 sources
' supported: A normal VB picture you can set in the UserControl Properties box, a Sub
' to directly pass an HBITMAP, and a Sub to pass a URL.
' PictureAlignment and PictureWatermark options are present and apply to all three image
' sources. Special thanks to Krool, the Picture option was adapted from his ListView
'
'-Added BackColor property, added ForeColor property for the main item text, and also
' ForeColorSubitem for the subitems when using Details View (Report Mode).
'
'-Added experimental Extended Tiles view mode. The layout is similar to Explorer's Content
' view, but I don't know how to use columns other than the ones that Detail View had.
' This option is disabled by default. If you want to try it, go down to the User Consts section
' immediately after these comments and change bHideContentViewMenuItem to True.
'
'-Added 'Enabled' option to enable/disable everything on the control.
'
'-Groups can now be subsetted: Only a certain number of items are shown with a link at the
' bottom to show more. Set the count with GroupSubsetCount and the text of the link with
' GroupSubsetLinkText. It defaults to no subsetting and there's default text of "Show more items"
'
'-Groups are now collapsible. Added GroupStartCollapsed option to set them collapsed by default.
'
'-Misc. adjustments to the Details Pane layout to support different DPI scaling and make better
' use of the space to avoid unneeded truncations.
'
'-When you click on a text field you can edit in the Details Pane, the textbox background will now
' turn white like it does in Explorer, and back to transparent when out of focus. This is to make
' it more clear that an edit is in progress.
'
'-Checkboxes can now be toggled during runtime, and there's a FileCheck event when checked/unchecked.
' Also, added FilesChecked() method to get list of checked items, and FileGetCheck and FileSetCheck to
' toggle checkmarks by name.
'
'-(Bug fix) View Menu and Bookmarks Menu did not work on Windows 10 due to missing FOLDERID_ values.
'
'-(Bug fix) Some internal file data was not being updated after a rename, which
'           caused failures in the shell context menu commands.
'
'-(Bug fix) There were a number of circumstances where actions on virtual objects,
'           usually in virtual folders, failed. Most of these have been corrected
'           thanks to the methods developed for the virtual folder custom colsets.
'
'-(Bug fix) 'New folder' and 'Paste' commands are now disabled in the menu when in
'           folders where they will not work.
'
'-(Bug fix) Corrected some spacing issues in the Details Pane when DPI scaling is on.
'
'-(Bug fix) In Files Only mode, the ListControlBox would slight reappear if the control
'           was resized to a small width then resized back. This was related to the
'           feature to auto-hide it; the control didn't check the mode so always restored.
'
'-(Bug fix) If the UserControl was not placed in the top left of the form, the column
'           select popup would appear in the wrong place. The reason was that the only
'           way I could get it to appear on top of everything was to set its parent
'           as UserControl.ContainerHwnd; no other method including SWP HWND_TOP worked.
'           So it was being placed relative to the form, instead of to the UC. Fixed.
'
'-(Bug fix) Some virtual locations, like Network Connections, were not showing the help text
'           (for the status bar) with the right-click menu; these folders seem to not support
'           the IContextMenu2 interface that was used. But the text only needs the base
'           IContextMenu, so that was made into a module-level var as well used in 2's place.
'
'-(Bug fix) When Group Mode was active and the folder changed, sometimes the group item count
'           was not updated or displayed the wrong number.
```

*New Events*
CustomColor(ItemIndex, ItemName, SubItemIndex, SubItemProp, rgbFore, rgbBack)
Item position and filename, the column number, and the system property name-- e.g. System.Size. Set rgbFore and/or rgbBack as desired, leave unchanged to stay with the current defaults.

FileCheck(Index, sFile, fCheck)
When Checkboxes are enabled and there's a change. fCheck = 0 for unchecked, fCheck = 1 for checked. File position and full path are sent.



*
New Methods*
CreateCustomFolder(Title, Files(), Icon)
View files from around the system together. Specify full paths for file list. If Icon is -1, the Saved Search system folder icon is used. If 0, a plain folder icon. If >0, specifies system imagelist index.

FileCount
Returns the number of non-folders.

FolderCount
Returns the number of folders.

FilePathFromPos
Returns the full path of the zero-based position of entries.

FileItemFromPos
Same, but returns an IShellItem.

PictureSetByHBITMAP
Specify an HBITMAP instead of picking the Picture property normally.

PictureSetByURL
Same, by URL.

FilesChecked()
Returns a list of the full paths of checked items.

FileGetCheck(FileName)
Get check status by filename.

FileSetCheck(FileName)
Set check status by filename.



*New Properties*
Enabled
Font
AllowSorting
DisableWow64Redirect
ExplorerStyle
SnapToGrid
HeaderDragDrop
TrackSelect
BorderStyle
SelectedColumn
Picture, PictureAlignment, PictureWatermark
ForeColor, BackColor, ForeColorSubitem
GroupSubsetCount, GroupSubsetLinkText
GroupStartCollapsed

----------


## fafalone

*Version 5.1 Released*
Jump to download



This new version brings a number of new and improved features and some important bug fixes.

*Highlights:*
Percent full bar graph in Computer (technically, any folder/items with the System.PercentFull propertykey will now render like this, but I've never seen it used elsewhere)Option for graphical Back buttonAll icons now support high DPIIf you change columns displayed, they're remembered if you go back to the folder

-The demo project lineup is the same as the 5.0 release, details in the post immediately above this one. Small change in that cLog is included and DemoEx logs debug output of compiled exe. 

-The standard resImages resource file is significantly smaller after removing unused icons and 128/256 pixel icon sizes used only in 16x16 spots.

Here's the full list of changes:


```
'-For high-DPI scaling, the control will now attempt to load the Control Box icons
' from the resource file, which contains icons with multiple resolutions for scale.
'
'-The menu icons, when available in the resource file, now also scale to DPI. The
' backup icons from picture boxes remain available for projects without the .res
'--Additionally, numerous positioning adjustments were made to make item positions
'  consistent with the standard appearance when running in high DPI.
'
'-In the Computer folder, the Percent Full (Space Used) is now displayed as a
' progress bar like in Explorer instead of just the number. Details View, Tile View,
' and Contents View are supported.
'
'-In Details View, the column set will be remembered when the folder is refreshed
' or navigated to again after leaving.
'
'-Added option to use an Explorer-style round back button on the left of the combo,
' or a new option to hide the back button entirely (Backbutton Property).
'
'-Added FileGetProperty function to retrieve properties.
'
'-Added HeaderNoSizing option to prevent header resize.
'
'-Added ControlBackColor option.
'
'-When Checkbox mode is enabled, a checkbox now appears in the 'Name' column
' header that allows you to check/uncheck all items.
'
'-Changes to the Control Box are applied during design-time as well.
'
'-Added SortItems event with column, direction, and property sorted by.
'
'-Added HighlightColumn[ByProperty] methods to change the background of a given column;
' the above SortItems event was added with highlighting the sort column in mind, but
' it can be used in any other way as well. NOTE: This uses undocumented interfaces and
' calls; it was working on Win7-10 as of release but be wary of future issues.
'
'-The main Libraries folder is now expanded by default in the directory dropdown.
'
'-Added EnableShellMenu option to control whether the right-click Explorer context menu shows.
'
'-The ListView border style can now be immediately changed during both design-time and runtime.
'
'-Added FoldersOnly option that controls whether files are listed in the main view area, as
' opposed to the dropdown (this option does not effect the dropdown).
'
'-In the Details Pane, fields that can be edited are now highlighted with a border during
' mouseover (and while editing).
'
'-(Design mode) Control Type changes are now applied in design time without close/reopen.
'               But it is not possible to change the control type at runtime.
'
'-(Bug fix) If the Bookmarks Button was enabled, but the View Button wasn't, the
'           Bookmark Button wasn't positioned right and would not show up.
'
'-(Bug fix) The Bookmarks Menu icons were not DPI scaled.
'
'-(Bug fix) The stars for the Rating column were mistakenly drawn after the column
'           was removed in a directory change.
'
'-(Bug fix) The status message containing the selection count, while in Checkbox
'           mode, was only updated after a normal select action instead of the
'           checkbox toggle.
'
'-(Bug fix) The AllowSorting option couldn't be turned off during runtime.
'
'-(Bug fix) When you double-click a folder, the '1 file selected' didn't clear after
'           the new location was opened, therefore incorrectly indicating that a file
'           was still selected.
'
'-(Bug fix) Checkboxes were being handled as if they were the selection; this was
'           causing issues with previews, details, and some other areas. 'Selected'
'           now always refers to just the highlight, and 'Checked' is an entirely
'           different thing.
'
'-(Bug fix) Some registered preview handlers fail to load. This situation is often
'           fixed by trying different arguments in CoCreateInstance; all 3 ways are
'           now attempted before giving up.
```



Special thanks to Charles P.V. for his ucListView control, from which I adapted the subitem progress control.

Download up top

----------


## MountainMan

Fafalone,

I am having trouble with your demos. In the first one there is a reference to:

ResFile32="..\resImagesNoMan.RES"

but there is no such file in the package.

Also, the projects in Demo2 and Demo3 do not have any references to resource files and do not have manifests but they do have a reference to v5 of the common controls so they have no visual styles. Was that intentional?

----------


## fafalone

Damn I specifically checked to make sure the demos were referencing the right resource files... no idea how that changed, I went through every one to check it referenced resImagesStd. You can swap it for the .res that is included; that reference is an alternate version without a manifest (see here in post 2), or redownload it after I update it in a second. Sorry about that.

For 2 and 3; yeah I had left out a manifest and resource on purpose, to demonstrate the simplest usage of the control. The reference (which is actually to 6) should have been removed; nothing from either ocx is used in the control or any demo.

Edit (23 Dec 2018): *Project Updated*. Fixed the reference in Demo, removed unneeded mscomctllib reference in Demo2 and Demo3. I had added a FollowLinks option to open folder links inside the browser, so updated the main control while I was at it.

Edit (11 Jan 2019): *Project updated to Version 5.12*. There was previously no 'Files Only' mode where folders could be hidden from the main file view. This is a fairly egregious oversight that warranted an immediate update instead of waiting for the next full version increment. There's also a few other improvements:
-Custom filter for when ItemFilter isn't enough; raises the FilterFile event.
-Bug fix for Drives Only mode where changing to a non-root path loaded the folders.
-Bug fix for the PercentFull progress bars; they only appeared in Tile Mode if you switched to it while in the Computer folder; also they're now blue instead of green:
The ProgressBars for the Computer folder are drawn using the Theme API, rather than actually creating a progress control, and unlike an actual progress control, the Theme API for progress bars allows the blue that you see in Explorer.

----------


## fafalone

Version 5.2 Released

This version adds new combo box styles - both dropdown list (all modes where its visible) and simple combo (for dir only/drive only). In addition, it can be enabled/disabled for typing, and when typed into can be used for navigation. The ListView Header has some improvements too, the FilterBar can now be shown, and has built-in filtering and optional manual override, and can now be shown in all views for that filtering or just because. The Column Select list is no longer stuck; you can now resize it and drag it around. 
Then for those odd folks wanting to use this without a CC6 manifest, you can now switch views during runtime and thumbnail mode actually works semi-well now.
Finally there's some positioning adjustments and a few bug fixes, included the unloading issue that was up in Known Issues for a while.
Here's the full changelog:


```
'-Added ComboType option to make the directory dropdown appear as the DropdownList
' style instead or, if in DrivesOnly or DirOnly mode, a simple combobox.
'
'-Added ComboCanEdit option, which allows (except in ComboType=DropdownList) you to
' edit the combo text. Double-clicking will set it to the full path of the current
' folder, and pressing enter will navigate to the given location- specify a full path
' or the name of a folder in the currently displayed location.
' This is accompanied by the ValidateTextNav event, if you wanted to set shortcuts
' or otherwise adjust/replace the text entered into the box when enter is pressed.
'
'-Added FilterBar option to show filter bars in the column headers. The filter is
' matched by default as follows: If a wildcard (*) is present, the comparison uses
' VB's Like statement; otherwise, it's matched char by char from the left, e.g. ab
' would match abc.txt, but not cabc.txt.
'--FilterCaseSensitive option was also added to control case sensitivity for the filter.
'--Event FilterBarOverride was added to allow for custom handling/more complex filters.
'  The filter text, column text, and filename are provided. Set fShow to 1 for a match,
'  0 for no match, and do not set it at all if you are not using this feature.
'--This feature is compatible with Group View: If Group View is not enabled, it creates
'  a single group with the matches. If Group View is enabled, it simply removes items
'  that don't match from their groups.
'--Also included is the FilterBarApplyManually public sub, so that a filter bar action
'  can be executed without even having to enable the filter bar.
'
'-Added HeaderInAllViews option, which if enabled shows column headers in the other
' view modes besides Details. The FilterBar can be used in this scenario.
'
'-The Details list of all properties to show (Column menu->More...) can now be moved
' around and resized.
'
'-Default column width is now pegged to m_ScaleX (DPI zoom).
'-Folder dropdown height is now pegged to m_ScaleY.
'
'-Made various positioning updates to Details Pane.
'
'-Added rudimentry support for thumbnails without Common Controls 6. The images won't
' appear nearly as nice, as semi-transparent pixels stay black, but fully transparent
' pixels use masking to change them to the background color.
'
'-It is now possible to switch view modes at runtime without Common Controls 6. This
' isn't possible by default, so the entire ListView is destroyed and recreated in the
' new view. Details are still supported, but tile view, content view, and group view
' modes are still all unavailable.
'--Unsupported modes are no longer shown on the View Menu, and automatically switched
'  to Large Icon view if set during design-time.
'
'-(Bug fix) If the control was on a secondary form, unloading that form did not unload
'           the control, and it stayed loaded in the background until the whole program
'           ended. Thanks to dz32 and Eduardo- for figuring out the solution.
'
'-(Bug fix) Ratings stars were not rendering if the ListView was scrolled horizontally.
'
'-(Bug fix) The global variable containing the current path was updated in .BrowserPath
'           before the location was validated; this could lead to various problems with
'           interacting with files in the current view after entering an invalid path.
'
'-(Bug fix) The Details Pane and Preview Pane were still visible if enabled when the
'           control type lacked a file view (DirOnly/DrivesOnly).
'
'**NOTE** This control is nearing feature-complete. I expect the next update will be to
'         finalize things; massively clean up the code, remove all unused methods, pare
'         down debug output and switch off by default...
'         SO... If there's any features you'd like to see in this control, or ucShellTree
'         which will be finalized at the same time... now would be a great time to drop by
'         the thread or e-mail me!
```









To repeat the note, any ideas for additional functionality, let's hear 'em soon, it's time to set this as feature-complete and clean it up.  :wave:

----------


## IliaPreston

This is a great control. I am using it.
I know that you plan to improve it. That is why I would like to bring to your attention a number of changes that would be nice to have:

1.  In the current version of ucShellBrowse, the user can type or paste anything in the combobox on the top-left where the user navigates through the folders.
That kind of input should be disallowed, because that combobox is not a real address bar. It implements a tree structure somewhat similar to the left panel of Windows Explorer.
It is not similar to the address bar of the Windows Explorer.
So, the fact that the user can type (or paste) things in there (and then press Carriage Return and nothing happens) is confusing.

2.  The navigation buttons look very different from Windows Explorer.
Also, in the current version of ucShellBrowse, there is no Forward button:
https://i.imgur.com/XVYkBga.jpg
It would be good to have a forward button as well, and also it would be nice for these navigation buttons to look the same as what they look in Windows Explorer.

3. In the current version of ucShellBrowse, the Status bar as a whole (as well as its partitions (I guess it consists of two partitions)) have a very dim (almost invisible) border line:
https://i.imgur.com/XmUxCrn.jpg
It would be nice if the Status bar (as a whole) and also the vertical divider line(s) inside it, could be made very visible and conspicuous.

Just my humble opinion.

Thanks.
Ilia

----------


## fafalone

1) The ComboBox is in fact also an address bar, from version 5.2:


```
'-Added ComboCanEdit option, which allows (except in ComboType=DropdownList) you to
' edit the combo text. Double-clicking will set it to the full path of the current
' folder, and pressing enter will navigate to the given location- specify a full path
' or the name of a folder in the currently displayed location.
' This is accompanied by the ValidateTextNav event, if you wanted to set shortcuts
' or otherwise adjust/replace the text entered into the box when enter is pressed.
```

2) The Back arrow can be drawn with actual Explorer theme; the 'BackButton' property can be used to switch to that one if you prefer; set it to SBBK_ThemeButton.
Will definitely work on a forward button at some point; I keep getting a headache when thinking about all the scenarios to track to not lose place going back and forward while opening new folders in between lol.

3) Not sure what can really be done about that... adding the WS_BORDER style adds a border at the top, but not the bottom. I'm going to add an option to add a border around the whole control; not sure if that's an acceptable solution for this though. The divider line, can't do anything about that short of custom drawing the whole thing.
One possibility might be putting a line control under it; will see if I can make that look decent. Edit: Even setting the statusbar to bottommost, it draws on top of the line. You'd have to put this on your form rather than in the control itself.

----------


## IliaPreston

A number of little problems:

1.  There is a problem with de-selecting a file.
I have some code that shows the name of the selected file in a textbox, when I click on a file, the ucShellBrowse1_SelectionChanged event is fired and my code in there shows the file path in the textbox.
But, then I click on the white space between the file thumbnails, and that event does not get fired.
And there isn't any other way to blank out that textbox if the user de-selects a file.
I have tested with any of the following:


```
Private Sub ucShellBrowse1_SelectionChanged(arFullPaths() As String, sFocusedItem As String, siFocused As oleexp.IShellItem)
   If ucShellBrowse1.SelCount = 0 Then
      txtFileSelected.Text = ""
   Else
      txtFileSelected.Text = ucShellBrowse1.SelectedFile
   End If
End Sub
```

Or:


```
Private Sub ucShellBrowse1_SelectionChanged(arFullPaths() As String, sFocusedItem As String, siFocused As oleexp.IShellItem)
   If UBound(arFullPaths) - LBound(arFullPaths) + 1 = 0 Then
      txtFileSelected.Text = ""
   Else
      txtFileSelected.Text = arFullPaths(0)
   End If
End Sub
```

And the problem with de-selecting a file happens in both cases.
2.  Also, when I was experimenting with this control and did some selecting and de-selecting files several times, suddenly a strange message showed up:
https://i.imgur.com/58G8J1j.jpg
Why did that message show up?
How to avoid it?
3.  Another thing that caught my attention is that that message that showed up for an unknown reason (the above screen print), is not a hard message (unlike a VB6 MsgBox).
I can click on the form itself, and that message goes BEHIND my application!!!
This could pose some problems and confusions.
If a message is to pop up, it needs to be a HARD message on the screen (just like a VB6 MsgBox)
4.  If I set a breakpoint inside that event (ucShellBrowse1_SelectionChanged), I see that when I select a file, that event is fired two times. Sometimes three times.
Is this normal?
5.  And last thing: If the user double-clicks on a file (or selects a file and presses Carriage Return), nothing happens.
There is a FileClick event, but there isn't a FileDoubleClick event.
Currently I have a "Process File" commandButton. The user can select a file and then click on that "Process File" commandButton to process the file that he has selected.
What I need to do is to let the user double-click a file (or alternatively, select a file and press Carriage Return) and that file would be processed.
How can I do that?
Please advise.
Thanks.

----------


## fafalone

1) I can add an event like SelectionCleared

2) That message comes up when you start a drag and then drop it within the view (but not on a folder or other droptarget). I'll take a look at ways to suppress it.

3) If I can find a way to suppress it that should do the trick; the message originates from Windows though, not the program, so that's why the placement is like that.

4) There's only one single RaiseEvent statement in the entire control for that event; I'll have to see if I can reproduce that issue.

5) The FileExecute event fires on both double-click and return.

I'm going to have to push next release back a day or two, forgot how much work it is to add another navigation button. I'm adding the forward button and the navigation menu dropdown to display a menu containing the nav history.

----------


## IliaPreston

#1. In the case of de-selecting a file there are actually two different solutions that come to my mind:
A) Maybe a SelectionCleared event is right as you suggested. 
In that case probably the name of that event had better be FileSelectionCleared instead of SelectionCleared (I will explain why below)
B) But, maybe the existing SelectionChanged event can also be tweaked.
In that case when the SelectionChanged event is fired (as a result of deselecting a file), the array arFullPaths() will need to be empty and ucShellBrowse1.SelCount will need to be zero, so that any of the two code snippets in post #34 would work (checking whether the value of ucShellBrowse1.SelCount is zero or checking whether the length of the array arFullPaths() is zero)Not sure which one of the above two approaches A or B is best.
#2 & #3. I think ucShellBrowse needs a property called AllowDragAndDrop.
And when this property is True, the user can drag and drop, and when it is false, any drag and drop is suppressed.
And last thing is about the name of that event "SelectionChanged".
Honestly, I believe the name of that event should be FileSelectionChanged instead of SelectionChanged
Why? Because there is another event called DirectoryChanged.
How come the name of that other event DirectoryChanged explicitly specifies it is the Directory that has changed, but the name of SelectionChanged event does not explicitly specify what exactly it is that has changed?
We know it is a File that has changed, but the two names are not consistent.
So, I believe for the reason of consistency (and only for consistency), the event SelectionChanged had better be renamed to FileSelectionChanged
Also, if you choose to implement that SelectionCleared event, the name had better be FileSelectionCleared instead of SelectionCleared (Only for the reason of consistency)
Just my humble opinion

Thanks.
Ilia

----------


## IliaPreston

I keep experimenting with this control (ucShellBrowse) and if you don't mind, I share my viewpoints and comments.
Hopefully my comments could be helpful.

#6. Currently ucShellBrowse does not provide any possibility for the focus to be set back to a specific file after some user action sets focus to some other control on the screen.
For example: I can click on a file in ucShellBrowse.
That single click selects (highlights) that file. (There will be a light blue rim around the file's thumbnail)
I can now use the arrow keys to freely navigate to other files.
But, if I press Carriage Return, the following code is invoked:


```
Private Sub ucShellBrowse1_FileExecute(ByVal sFile As String, siFile As oleexp.IShellItem)
   Call cmdFileProcess_Click
End Sub
```

And then, the focus on the file that was processed is lost. (That light blue rim is now gray instead of light blue, which means that that file is not ACTIVELY selected)
If I want to select that same file again (for the purpose of using arrow keys to navigate to the next file), I cannot set the focus back to that file in the procedure "ucShellBrowse1_FileExecute"
There is no such thing as ucShellBrowse1.SetFocus or ucShellBrowse1.SetFileFocus
So, the user needs to click on that thumbnail again to access it.

This means that a smooth cycle of ArrowKey then Process then ArrowKey then Process, etc. is not currently possible.

The above means that something like a ucShellBrowse1.SetFileFocus or some other way of programmically setting the focus back to that file is needed.
#7. The exact same thing is needed in the very beginning when ucShellBrowse loads the contents of a folder, or when the DirectoryChanged event is fired.
The programmer needs a way to set focus to the first thumbnail that ucShellBrowse shows, so that the user won't have to do a click to select the first file.
8. When I set BackButton = SBBK_ThemeButton, the back button looks like what it does in Windows Explorer, but the "Up" button continues to look the way it does.
It does not follow the setting in the BackButton property, and there is no UpButton property either.
So, when BackButton = SBBK_ThemeButtonm the two buttons' appearances are very different and inconsistent.
Also, in that case (BackButton = SBBK_ThemeButton) the back button moves to the left of the address bar, which doesn't look very good.
It would be nice if the Up button would also look like the Up button in Windows Explorer.
And it would be nice if the Up button would reside next to the Back (and forward) buttons.
All three buttons should be to the right of the address bar, because the address bar should be left aligned with the main body of the ucShellBrowse that contains files.
Thanks

----------


## fafalone

1) Probably best to do both I would think.

2/3) This option already exists. FileDragDropMode has 4 options: Disabled, Drag Only, Drop Only, and DragDrop

'FileSelectionChange' would imply that the selection change involves a file, but folders are displayed in the ListView as well. One event is for within the ListView, the other is for what location is displayed there. Would really like to avoid breaking backwards compatibility if at all possible; so would suggest that you can rename the event uptop then run a replace for RaiseEvent SelectionChanged,

6) You must be doing something to lose the focus... or maybe what OS are you on? For me I can run code in ucShellBrowse_FileExecute without losing keyboard focus.
In any case, I added a SetFocusOnFiles method that sets focus on the ListView hWnd, should that should take care of it (I'll also add one for the combobox).
For a heads up, Tab-based navigation is not possible. It can be done if it's only just the ListView, but the IOleInPlaceActiveObject hack doesn't work when there's multiple subcontrols on the UC.

7) I'm not sure it's appropriate to select a file the user hasn't picked. Recommend doing this manually instead.
In your Form_Activate event (to cover the initial load), and in the ucShellBrowse_DirectoryChanged  event, you can do the following:


```
Dim sF() As String
sF = ucShellBrowse1.Files()
If sF(0) <> "" Then ucShellBrowse1.SelectedFile = sF(0)
ucShellBrowse1.SetFocusOnFiles
```

Note: SetFocusOnFiles is one of the updates I'm working on now, it's not in the release yet; just showing you how you'll do it when the update comes.

8) There is no themed 'Up' navbutton in the Theme API, at least that's documented. Will take a look. Maybe I could at least turn the other buttons into a tool bar; that would look slightly better. 
As far as alignment goes, I had went with the standard in Explorer and ComDlg and web browsers for the most part... can probably make an option out of it.

----------


## IliaPreston

> ......
> 6) You must be doing something to lose the focus... or maybe what OS are you on? For me I can run code in ucShellBrowse_FileExecute without losing keyboard focus.
> In any case, I added a SetFocusOnFiles method that sets focus on the ListView hWnd, should that should take care of it (I'll also add one for the combobox).
> For a heads up, Tab-based navigation is not possible. It can be done if it's only just the ListView, but the IOleInPlaceActiveObject hack doesn't work when there's multiple subcontrols on the UC.
> ......


I am using Windows 10 (64bit) on my desktop computer.
Here is the actual code:


```
Private Sub ucShellBrowse1_FileExecute(ByVal sFile As String, siFile As oleexp.IShellItem)
   Call cmdFileProcess_Click
End Sub

Private Sub cmdFileProcess_Click()
   MsgBox "Selected item:  " & ucShellBrowse1.SelectedFile, vbOKOnly, "Process"
End Sub
```

I run the process, then I manually select the first file. 
Now, (because the file is SELECTED) I can easily navigate to other files using arrow keys. I do so. I use arrow keys to navigate to another file. It looks like this:
https://i.imgur.com/4avLo4y.jpg
Then I press Carriage Return. The above code is invoked, and a messagebox is shown on the screen. It looks like this:
https://i.imgur.com/ls4thJe.jpg
Then I press spacebar to close the messagebox and end the process. It looks like this:
https://i.imgur.com/mHFW93X.jpg
As you see, at this point the file has a gray rim, and I cannot use arrow keys to navigate to another file until I manually click on that file or manually click on another file to set focus to it.




> 8) There is no themed 'Up' navbutton in the Theme API, at least that's documented. Will take a look. Maybe I could at least turn the other buttons into a tool bar; that would look slightly better.
> As far as alignment goes, I had went with the standard in Explorer and ComDlg and web browsers for the most part... can probably make an option out of it.


All I am saying is that it would be quite good if it would look like this mock-up:
https://i.imgur.com/BOakYZd.jpg
Not that it is very important. Just, it would be nice.

My humble opinion.

Thanks.
Ilia

----------


## fafalone

Yeah the messagebox is taking away the focus. The new call I put it will restore the gray to blue. 

Without a themed up arrow available from the Theme API, there's going to be the issue of either having the up arrow stored as a static image and therefore not matching on different Windows versions, or storing all of them statically, so they'd match eachother but not Windows except for whatever version I grab the images from. So I'm kind of inclined towards just leaving it as the standard icon that the common dialogs use. 

There's a whole lot of code changes involving anything to do with that top row; there's tons of complexity around sizing based on what's showing/hidden, and calculating when to autohide, etc. So it's not as simple as just dragging a control over in the IDE. 
BUT... I had a couple hours to kill, so now there's additionally a SBNB_ThemeBtnInBox option that places the back/forward buttons in between the combobox and the up arrow. 
So currently like this:



Edit: You had earlier asked about the SelectedFile type functions; it turns out there already are all the permutations you could want...
.SelectedFilePath = full path of selected file, e.g. C:\dir1\file.txt
.SelectedFile = just the name, e.g. file.txt
.SelectedFilesPaths() = array of selected file full paths like above
.SelectedFiles() = array of just selected file names

Also, can't find any time when .SelCount isn't accurate.


So as of right now, the last outstanding issue is what to do about the 'Up', 'View', and 'Bookmarks' button. Probably leaning towards a toolbar; if I did that, you'd be able to replace the icon with your own without it looking too different since text would be optional.

*Update* (March 1st)
It's funny that I included a comment about almost being feature complete. Then Mr. Preston there came along, and then a bunch of other new features were requested and I thought of a bunch more on top of that. I've been busily working on adding a whole bunch more stuff, that's why the update isn't out yet. 
Here's a preview of the changes added so far:
(Removed. Final changelog is posted below in the update announcement; no need for a confusing partial one here.)

But now I *think* I've got everything, except for changing the control command buttons to a toolbar. Hopefully this weekend.

----------


## IliaPreston

Is ucShellBrowse hot-key enabled too?
I am currently testing it and I can't make it react to keyboard.

Unlike ucShellBrowse, in Windows Explorer, the following hot-keys are available:
1.  Alt+D:  Moves focus to the addressbar and highlights it.
2.  Alt+LeftArrow:  Navigates to the previous folder (invokes the "Back" button).
3.  Alt+RightArrow:  Navigates to the Next folder (invokes the "Forward" button).
4.  Alt+UpArrow:  Navigates to the parent folder (invokes the "Up" button).
But in ucShellBrowse, in my tests I can't make those four actions possible via keyboard.
Please note that any of the above 4 actions could be desirable in any of the following two scenarios:
1.  The focus is on a specific file (the user has clicked and highlighted a file thumbnail in ucShellBrowse)
Now, the user wishes to use those above-mentioned hot-keys to invoke those functions.2.  The focus is somewhere else on the form, and the user wishes to use those above-mentioned hot-keys to invoke those functions.
For example, let's say the user is typing something in a textbox completely outside the ucShellBrowse (below screen print):
https://i.imgur.com/TJfpRs0.jpg
And while typing in there, the user wishes to to use those above-mentioned hot-keys to invoke those functions.
Is that possible?
How can I program ucShellbrowse to make that possible?

Thanks.
Ilia

----------


## fafalone

I've implemented some, but not all, of the usual Explorer shortcuts. You can look in the last procedure, ucWndProc, at the LVN_KEYDOWN notification, that's where they're handled.

To implement your own, there's the ListKeyDown event. Right now it's only set to respond when the ListView has focus, because of all the other controls on the UC. 
If it's a control that's not part of the UC, you'd handle them in that controls key up/key press event. The .SelectedFile[s] properties are also a Property Let so you can select file(s) by name. The SetFocusOnFiles and SetFocusOnDropdown methods are coming as soon as I post an update, should be tonight actually. I'll add explicit calls for those navigation shortcuts while I'm at it, e.g. ucShellBrowse.NavGoBack and .NavGoForward; and Alt+P to toggle the preview pane. 

Sorry for the delay in reply/update, have been crazy busy.

PS- The Backspace key is an existing shortcut for open parent.

----------


## fafalone

*Version 5.3 Released!*
Jump to download

There's another boatload of new features between what IliaPreston suggested and even more that just popped into my head. Maybe now we're getting close to feature complete? The only thing I didn't get to for this version was replacing the buttons in the control box with a toolbar. 

Let's get to it, New Features:


```
'New in v5.3 (Released 08 Mar 2019)
'-There is now a Forward button in addition to the Back button. The 'BackButton'
' option has been replaced with the 'NavigationButtons' option, which provides the
' same options; hidden, standard buttons, or themed buttons.
' Additionally, right-clicking either of the buttons will display the history as a
' menu where you can pick any item to navigate to (current location is in bold).
'
'-The themed back (and now forward) button now have the option to be placed in the
' control box immediately to the right of the combo.
'
'-Thumbnails can now be generated on demand the first time they're requested, so
' the control isn't slowed down creating off-screen thumbsnails. This behavior is
' controlled through the new ThumbnailPreload option which you can set to True if
' you still want to generate them all in advance (it's False by default).
'
'-Added the following keyboard shortcuts:
'   Alt+Left - Navigate back
'   Alt+Right - Navigate forward
'   Alt+Up - Open parent (Backspace key also does this)
'   Alt+D - Set focus on directory dropdown
'   Alt+P - Toggle Preview Pane
'   Ctrl+Shift+N - Create new folder
'   Ctrl+Y/Ctl+Z - Redo/Undo. Suppose to call Explorer's undo, but I'm getting an error when
'                  reading the Undo verb off the context menu; leaving this in because
'                  it might just be my system, but I can't guarantee this will work.
'
'-Added Public methods for navigation: NavGoBack, NavGoForward, and NavOpenParent.
'
'-Navigation, i.e. .BrowserPath and the Dropdown edit box, will now also open
' environmental variable shortcuts, e.g. %windir% will open C:\Windows (or whatever
' your Windows folder is). Must include the % on both sides.
'
'-Added PreDirectoryChange event that fires before the new location is enumerated.
' Includes fCancel option to block the switch.
'
'-Added SelectionCleared event. The normal SelectionChanged now also fires with empty
' variables and null shellitem.
'
'-Added SetFocusOnFiles and SetFocusOnDropdown methods for when items are selected but
' out of focus and you want to restore an active selection state again.
'
'-Added BorderStyleControl option to place a border around the entire control; the
' BorderStyle property is just for the file view.
'
'-Added an UpButton option to set whether that button is visible in the control box or
' not. This is the only button that wasn't optional; now that they are all, if you don't
' want any of them visible, please use the ListControlBox setting to hide the box itself
' instead of leaving it enabled but with zero items.
'
'-Added a few more Property Gets for control component hWnds.
'
'-There is now a StatusBarHeight property. The default is set at runtime so it can be
' scaled for DPI, so because of this the property won't be shown in the Design-Time
' property browser; nor is it in the PropertyBag for saving. The new property is just
' there in case of a rare circumstance where you might want to adjust it manually (this
' is not recommended without good cause).
'
'-The width and height the Back/Forward Theme Buttons are drawn at is now set by using
' GetThemeMetric, instead of the fixed Win7 value of 30, in case other Windows versions
' use different sizes-- eliminating potential degraded quality of an incorrectly scaled
' image size. 30 is still the fallback value if the API fails.
' Note: The value returned is already DPI-scaled, so scaling factors on the button offset
'       variables were removed; please note if there's ever incorrect sizing/positioning.
'
'-An ItemFilterFolder property and FilterFolder event were added to allow for an identical
' filtering setup to ItemFilter/FilterFile which applies to folders.
'
'-Added HeaderHotTracking property that toggles mouseover highlighting of the ListView's
' Column Headers when Common Controls 6.0 are not loaded. If CC6 are loaded then there is
' always mouseover highlighting.
'
'-Added code option bDisableProgressItems to disable drawing progress bars as ListView
' subitems. This is set below this comment area in the 'User Consts' code block.
'-Added code option bStatusBarInheritCtlBkColor; only applies without ComCtl6.
'
'-Adjusted the height of the Control Box buttons to better fit with the Navigation Theme
' Buttons, and the ComboBox when at high DPI. Allows better quality images as well.
' Note: At this time, the images on the Navigation Buttons when they're standard buttons
'       instead of themed are not scaled, so if you're on a scaled high-DPI monitor it's
'       advisable to always use one of the Theme Button options.
'
'-A number of potential memory leaks on unload have been addressed by thoroughly expanding
' the references released and handles destroyed when the control terminates.
'
'-(Bug fix) Overlay icons were missing in Thumbnail View when ComCtl6 was enabled.
'
'-(Bug fix) The Windows lock overlay icon triggered an error when being copied, when
'           in Thumbnail View, that would stop the file enumeration at that point.
'           In other modes, a different overlay is shown, there's no known fix for this.
'
'-(Bug fix) Some FileDragDropMode options were only applied if set at runtime.
'
'-(Bug fix) When changing the Back Button (now NavigationButtons) style, the themed
'           buttons were sometimes not redrawn right away, especially at design time.
'
'-(Bug fix) The CBES_EX_TEXTENDELLIPSIS Combo style was causing repaint issues where the
'           combobox would disappear until mouseover/resize. Applying it after the call
'           to CreateWindowEx instead of in it fixed the issue without removing the style.
'
'-(Bug fix) The StatusBar height is now adjusted for DPI; previously the bottom of letters
'           might have been cut off depending on the font.
'
'-(Bug fix) If the NavigationButtons were set to ThemeButtons and the control was in DirOnly
'           or DrivesOnly mode, artifacts of the buttons were visible behind the dropdown as
'           these buttons were still being mistakenly drawn.
'
'-(Bug fix) The ComboCanEdit property introduced in the last version couldn't be changed
'           from the default because the Property Let didn't actually change the variable.
'
'-(Source Code) All Enums have been case-locked. Previously only some were.
'
'-(Source Code) Consolidated all English-language strings to module-level consts in the User
'               Options below this changelog, so that it's much easier to localize into a
'               different language. All English-language strings are now either in that group
'               or in the QueryMenuTip function.
```

Here's the new Forward button in the new position option (placing them on the left side is still an available option); also shown is how the control box buttons were resized so they look better next to the themed buttons (which can't be easily resized without serious distortion). 
 
The pic on the right shows the new History Menu where you can navigate all the forward/backward locations; right-click either one of the fwd/back buttons (when enabled) to show it. Also, these buttons aren't just static images, they show all available states-- disabled when there's nowhere to go, the normal state in the pics above, a 'hot' state when the mouse is over them, and a 'pressed' state while being clicked.
And since the buttons are drawn with the Theme API rather than stored as static images, you'll see buttons consistent with your Windows version. Here's the control running on Win10, with one of the buttons in the 'hot' state because the mouse is over it:


*NOTE:*  If you're using one of the Alternative Resource Files, a new version of the Bookmark icon was needed for ucShellBrowse v5.3 so if you're using one of these alternatives, please download the new version marked v2. If you're adding the image files from ResourceImages.zip, add ICO_NEWBKM to your project. The default resImagesStd.res resource file that's included in the main download has also been updated.

----------


## IliaPreston

Hi
I just downloaded the new version 5.3 and am experimenting with it.
Thanks for the new version.
There are however, a few issues with this new version:

1. The new property "SetFocusOnFile" almost doesn't work.
I have this code:


```
Private Sub ucShellBrowse1_FileExecute(ByVal sFile As String, siFile As oleexp.IShellItem)
   Call cmdFileProcess_Click
End Sub

Private Sub cmdFileProcess_Click()
   MsgBox "Selected item:  " & ucShellBrowse1.SelectedFile, vbOKOnly, "Process"
   ucShellBrowse1.SetFocusOnFiles
End Sub
```

I select a file, and use the arrow keys to move and select another file. Therefore the selected file appears to be highlighted (it will have a light blue rim).
Then I press Carriage Return. Therefore the above messagebox appears. (and the file's rim changes to gray).
Then I click on the "Ok" button on the messagebox. 
Then the selected file's rim will change back to light blue, giving me the APPEARANCE that that file has focus again.
But, it doesn't really have focus, because then I press the right arrow key to move to the next file, and at that point, it doesn't move to the next file. Instead, some other control on the form (a textbox below the ucShellBrowse) gets focus! And I can type in that textbox.

2. The Back and Forward buttons have a problem.
I have this code:


```
Private Sub Form_Load()
   Me.Show
   DoEvents
   ucShellBrowse1.Visible = False
   
   ucShellBrowse1.ViewMode = SB_VIEW_THUMBNAIL
   ucShellBrowse1.FileDragDropMode = SBDD_Disabled
   
   ucShellBrowse1.BrowserPath = "C:\MyFiles\MyVids\Music\Classical-Music"
   
   ucShellBrowse1.Visible = True
   
End Sub
```

The form loads properly.
Then I navigate to the this folder: *C:\MyFiles\MyVids\Music* which is the parent folder.
The navigation happens fine. ucShellBrowse shows the contents of the parent folder.
Then I click on the "Back" button.
At this point, ucShellBrowse goes to the wrong folder. It mistakenly goes to *C:\Dev\VB6\FS2*. This is my vbp project folder.
It looks like ucShellBrowse THINKS that the previous folder is the vbp project folder.

At this point, clicking on the Forward button doesn't move to any folder.

After several times of navigation, then the back button starts to work properly, but in the beginning (the scenario that I just explained in the above), it malfunctions.
The Forward button always malfunctions. It doesn't do anything most of the time.

Please advise.
Thanks.

----------


## fafalone

1) I'll have to make a post about this in the main forum. I can't find any way to set keyboard focus back; even sending LBUTTONDOWN/LBUTTONUP isn't working-- restores the black focus rectangle, but then still arrow keys navigate to another control. Very weird.
Update: Fixed
Another control was somehow stealing the focus, the solution is to add a timer before the SetFocus call. I'll update the project shortly, if you want to add it to the current version without waiting, here's what you do:
a) Add the following module-level declares,


```
Private Declare Function SetTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Private Declare Function KillTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long) As Long
Private mTmrProc As Long
```

b) At the bottom of the control code where all the subclassing procedures are, add the following above FWWndProc as ordinal #11,


```
'@11
Private Sub FocusTimerProc(ByVal hWnd As Long, ByVal uMsg As Long, ByVal TimerID As Long, ByVal Tick As Long)
    KillTimer hWnd, TimerID
    If hWnd = hLVS Then DoSetFocus
    If hWnd = hCombo Then DoCBFocus
End Sub
```

c) Delete the existing SetFocusOnFiles/SetFocusOnDropdown subs and replace them with this,


```
Public Sub SetFocusOnFiles()
If mTmrProc = 0& Then mTmrProc = scb_SetCallbackAddr(4, 11, , , True)
SetTimer hLVS, WM_USER + 99, 10, mTmrProc
End Sub
Private Sub DoSetFocus()
DoEvents
SetFocus hLVS
End Sub
Public Sub SetFocusOnDropdown()
If mTmrProc = 0& Then mTmrProc = scb_SetCallbackAddr(4, 11, , , True)
SetTimer hCombo, WM_USER + 98, 10, mTmrProc
End Sub
Private Sub DoCBFocus()
DoEvents
SetFocus hCombo
End Sub
```

2) The initial path is your project folder; so it looks like the first .BrowserPath call isn't being added to the history list possibly.
That might be causing an issue with the forward button too; what does the history menu look like? (right click the button) 
It works normally for me so I'll have to try to recreate the issue; will take a look tomorrow.

Edit: #2 looks like it can be entirely fixed by comment out the two occurrences of m_sCurPath = sPath in .BrowserPath [PropertyLet]. Setting the path there was interfering with the history list processing in LVLoadFolder, which updates that variable on its own anyway.


Sorry for not catching these before release. There's a couple other issues I want to fix before updating, which I'll do tomorrow or the day after. I'm also adding a built-in search-- it already supports custom file sets, so it's just natural to go ahead and add in a Search Box like Explorer:

----------


## IliaPreston

> 1) I'll have to make a post about this in the main forum. I can't find any way to set keyboard focus back; even sending LBUTTONDOWN/LBUTTONUP isn't working-- restores the black focus rectangle, but then still arrow keys navigate to another control. Very weird.
> Update: Fixed
> Another control was somehow stealing the focus, the solution is to add a timer before the SetFocus call. I'll update the project shortly, if you want to add it to the current version without waiting, here's what you do:
> a) Add the following module-level declares,
> ...
> b) At the bottom of the control code where all the subclassing procedures are, add the following above FWWndProc as ordinal #11,
> 
> 2) The initial path is your project folder; so it looks like the first .BrowserPath call isn't being added to the history list possibly.
> That might be causing an issue with the forward button too; what does the history menu look like? (right click the button) 
> ...


Thanks a lot for the response.
And thanks for this great control (ucShellBrowse). It is really a good one.

Also, as I keep testing it, I found two other issues:

1. Sometimes (not always) when I click on the save button, it gives me this error:
https://i.imgur.com/6gGAjal.jpg
Strange, but, this never happens in my other vbp projects. It only happens in this project that has ucShellBrowse.
And it also never happened with previous versions of ucShellbrowse. It only happens with version 5.3

2. Sometimes (not always), it gives me an error: Out of memory. (I don't have a screen print of this one.)
My computer is actually a very powerful desktop with 12 GB of memory and the best of all specifications. So, this Out of memory error is really strange.
And again, it never happened with previous versions of ucShellbrowse. It only happens with version 5.3

Both of these issues happen just sometimes, not always.
I guess there could possibly be some sort of memory leak or something similar. Not sure though, but definitely there is some problem because these symptoms never existed prior to version 5.3, and they never happen in my other vbp projects.

Thanks again for this great control.

Ilia

----------


## fafalone

I've never encountered these error before; according to MSDN the first one is "Invalid window handle"

Can you give me an idea of what you were doing before these errors were triggered? In the IDE, compiled exe, or both? If I can find a way to reproduce them I can track it back to which change caused the issue.

----------


## IliaPreston

> I've never encountered these error before; according to MSDN the first one is "Invalid window handle"
> 
> Can you give me an idea of what you were doing before these errors were triggered? In the IDE, compiled exe, or both? If I can find a way to reproduce them I can track it back to which change caused the issue.


I am testing it in VB6 IDE. I have not cut an executable.

I have a test vbp project. Everything that I am not sure about or every new thing that I want to test and understand, I test in this test vbp. For every new thing to test, I usually add a new commandbutton.
For this new control (ucShellBrowse), I added a new form to this test project (it is called Form3), then added ucShellBrowse, and a few other controls:
https://i.imgur.com/U2vFsWQ.jpg

And what exactly I am doing?
Main thing: *I am trying to use arrow keys to move from file to file (in ucShellBrowse), and press Carriage Return on each file (thereby processing it)*
I also sometimes press Alt+UpArrow, Alt+LeftArrow or Alt+RightArrow to navigate. (I do these whether when the focus is in ucShellBrowse or when the focus is on other (few controls) on the form
In other words, I try to play around with this new control (to make sure it is ok) before using it in a real project.

And here is the entire code behind this form:



```
Option Explicit


Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
   
   Dim CombinedKey            As String
   
   CombinedKey = "" & KeyCode & "-" & Shift
   
   
   'Main: User's keyboard command processing
   Select Case CombinedKey
      Case "38-4"                               ' Alt+UpArrow
         txtItemId.Text = "Alt+UpArrow :: " & CombinedKey
         KeyCode = 0
         Shift = 0
      Case "37-4"                               ' Alt+LeftArrow
         txtItemId.Text = "Alt+LeftArrow :: " & CombinedKey
         KeyCode = 0
         Shift = 0
      Case "39-4"                               ' Alt+RightArrow
         txtItemId.Text = "Alt+RightArrow :: " & CombinedKey
         KeyCode = 0
         Shift = 0
      Case Else
         Exit Sub
   End Select
   
End Sub

Private Sub Form_Load()
   Me.Show
   DoEvents
   ucShellBrowse1.Visible = False
   
   ucShellBrowse1.ViewMode = SB_VIEW_THUMBNAIL
   ucShellBrowse1.FileDragDropMode = SBDD_Disabled
   
   ucShellBrowse1.BrowserPath = "C:\MyFiles\MyVids\Music\Classical-Music"
   
   ucShellBrowse1.Visible = True
   
End Sub

Private Sub ucShellBrowse1_DirectoryChanged(ByVal sFullPath As String, siItem As oleexp.IShellItem)
   lblMessage.Caption = ""
End Sub

Private Sub ucShellBrowse1_FileExecute(ByVal sFile As String, siFile As oleexp.IShellItem)
   Call cmdFileProcess_Click
End Sub

Private Sub cmdFileProcess_Click()
   MsgBox "Selected item:  " & ucShellBrowse1.SelectedFile, vbOKOnly, "Process"
   ucShellBrowse1.SetFocusOnFiles
End Sub

Private Sub ucShellBrowse1_PreDirectoryChange(ByVal sFullPath As String, fCancel As Long)
   lblMessage.Caption = "Please wait ... "
   Me.Refresh
End Sub

Private Sub ucShellBrowse1_SelectionChanged(arFullPaths() As String, sFocusedItem As String, siFocused As oleexp.IShellItem)
   If UBound(arFullPaths) - LBound(arFullPaths) + 1 = 0 Then
      txtFileSelected.Text = ""
   Else
      txtFileSelected.Text = arFullPaths(0)
   End If
End Sub
```

And one other (very strange thing that just happened a few minutes ago:

Yesterday, I was testing this, and then left it. I saved it, but left it open in VB6.
Today, I just saw your response (post #47), and started to respond. The main form was on (and not Form3 that contains ucShellBrowse). So I clicked on Form3 in vb6 project explorer (top right of the VB6 IDE), to copy the code for this post. It gave me an error (I forgot to take a print screen, but said something was wrong and written in the error log.)
I clicked ok. Then it showed Form3 but ucShellBrowse was missing.
I closed VB6 without saving. Then opened VB6 again and opened this test project in VB6, and ucShellBrowse WAS there (and still is there) as if nothing had gone wrong.
In the log file, there is just one line:   Line 13: Cannot load control ucShellBrowse1.
Something should be wrong. I don't kow what, but, something is somehow causing instability

Other notes:
When I downloaded version 5.3 (a few days ago), I first closed VB6. Then I deleted the previous version from my hard disk. I deleted these three files:
ucShellBrowse.ctl
ucShellBrowse.ctx
resImagesStd.RESThese three files are the only files from ucShellBrowse that I use.
Then I unzipped the new version (5.3) and copied the new version of these three files into my vbp project folder, and then opened VB6 IDE again.
I don't remember if I deleted ucShellBrowse from Form3, and added it again, or it was there.

Hopefully the above will help with tracking down the source of the problem.

----------


## IliaPreston

There is also another problem with ucShellBrowse. This one is a real showstopper.
As I keep testing ucShellBrowse, so far I have been testing it only in IDE.
But now for the first time, I tried to cut an executable and test the executable.

The executable doesn't even start!
When I double-click on the exe file, it gives me a strange error that I had never seen before:
https://i.imgur.com/t6MGrQX.jpg

My vbp project has nothing other than ucShellBrowse in it (aside from very few trivial controls).
So, that is the only thing that could have caused this.

Also, please note that I just cut new executables of several of my other vbp projects and all those executables start and run properly.
This Test003.vbp is the only one that has this problem (and the only one that has ucShellBrowse).
Also this same Test003.vbp runs properly in the IDE. Just its executable doesn't start.

I am attaching this whole project in here:
http://www.mediafire.com/file/o4uxmh...st003.zip/file
I don't know how to fix this.

Please help.
Thanks.
Ilia

----------


## fafalone

There's something funky happening to the manifest... the .exe in your zip didn't run, throwing the same error (it's a Windows Side-by-Side (sxs) component error, related to Common Controls 6.0), but when I opened the .vbp and recompiled, it ran fine. The critical difference is here's the manifest of your exe on the left, and recompiled with no changes whatsoever on the right:


Did you compile the exe straight from the vbp file as it exists in the zip; did you in any way modify the resource file after it was compiled? Or even possibly before? Anything other than Open prjTest003.vbp, Compile, then run prjTest003.exe? What happened is somehow your manifest file got encoded in UCS-2 instead of ANSI -- see the StatusBar in ResourceHacker? I'm not sure how that would happen; all my copies I've ever made come up in ANSI in ResourceHacker.
Edit: Also, the resImagesStd in \Test003\ucShellBrowse is correctly loaded as ANSI, so now I'm really confused as to where you've picked up the UCS-2 change.


PS - I've been playing around with your demo project trying to replicate &H80070578 (Invalid Window Handle) when you click Save, but I just can't find a way to trigger it. I've tried force-stopping at every point I can think of, changing code and force stopping, changing code then regular quits... can you think of any way to at least narrow it down, or is it just completely random? I did stick in my dev version who knows maybe a strange bug will vanish instead of appear lol. Dev version confirms arrow-enter-ok-arrow-enter-ok-etc to process files is working fine at least.

As for memory; I've had the demo I've been using to develop it open non-stop since March 19th (obviously a couple weeks just running untouched, but also a couple weeks of heavy development), and that instance of VB6.EXE is still only up to 150MB of RAM according to Process Explorer; any help narrowing down how to trigger a memory error would be helpful as well.

----------


## IliaPreston

Hi.
I created the exe file (prjTest003.exe) directly from the vbp files that I included in the zip file).
All that project that is the vbp file, the Form3.frm file and the resImagesStd.RES in the zip file are exactly the ones that I have in here as my prjTest003.vbp project.
So, in that zip file, you have an exact replica of all I have in here.

You can also compare resImagesStd.RES in my zip file with the resImagesStd.RES in the ucShellBrowse version 5.3. It is the same.

I just opened that vbp project in the VB6 IDE. Then I went to File -> Make prjTest003.exe and made the executable.
Once done, I opened Windows explorer, went to C:\Dev\VB6\Test003 and in there I first verified (based on the timestamp of the prjTest003.exe), that it was the one I just had made a few seconds ago, and then I double clicked on prjTest003.exe, and that error happened.

Also, I can see this in resource hacker:
https://i.imgur.com/lMmscDy.jpg
But, I don't know why it is the way it is, and how to fix it.
Really strange.

As for the other two problems (1. Invalid window handle when I click save and 2. Out of memory), I can't recreate them either.
They happened a few times last week, and even then they didn't always happen. I ran the process numerous times, and only a few times one or the other one of those two problems happened.
Today, it looks like I can't recreate them.
But, I will keep trying

Thanks.

----------


## fafalone

The resource file you have is correct yeah that's not the issue.... I don't understand how the compiler is corrupting it. I compiled the exact file set you posted through my IDE and the manifest came through just fine. Going to have to post about this in the main forum later today and see if I can't track down some help.

I'll be working on fixing up these bugs exclusively now, finally finished the search feature, so if we can get these resolved hopefully an updated version is out tonight or tomorrow.


Edit: Posted here. Maybe someone else has encountered this.


Edit 2: Ok, please do this:
1) Open the Zip file you linked to in Post #49

2) Extract it to an entirely new location. Nowhere near any other VB files, not in the same root folder at any level, in fact just make a new folder in your C:\

3) Rename prjTest003.exe so it's not in the way at all.

4) Double-click prjTest003.vbp

5) Don't touch anything, just immediately goto File->Make prjTest003.exe and hit Ok to compile.

Try to run that new exe, and post the results in this thread I first linked to above so a few other people can see it.

----------


## fafalone

I'm attaching the most recent version of this control down here... there's some serious bugs that have been corrected, but a major navigation bug is looking like an even longer term fix since Windows 10 has profoundly broken a few APIs for getting shell items when navigating certain virtual locations-- e.g. phones and cameras. It's basically a crapshoot which API will work on which path, so I'm going to have to re-do a lot of stuff and create a whole bunch of fallback options for every navigation action. 
Basic straight-in navigation is working; but forward, back, up, and refresh are extremely iffy; they may or may not work. So that's an important fix compared to it not working at all. Shell notify should mostly work; in any case there won't be incorrect notifies (I think, at least on my Win10 version). 
Then there's several other bugs and the addition of an optional search box (off by default, but added a button in the demo). So now that it's feature complete, I wanted to put an interim update out for everyone before updating the master version, in case there's any other last minute bugs while I'm fixing the navigation. Also, there was an issue with compiling the manifest file from the demo project in Win10 that caused exe's to not run, because the text wasn't padded to 4 bytes. That's fixed now. Use the resource file from this version always; there's a couple graphics updates too.
Only the first demo will be included in this release.


```
'-Added an optional Search Box to the control box. You can type in a search string,
' press enter, and it will search the current folder and its subfolders, then use
' the Custom File Set functionality to display the results.
' Note: Running a search will replace any existing custom file set you previously
'       loaded; search counts as custom and currently only one custom is supported.
'
'-Main control border styles now include non-standard Thick/Thicker (resizable)
' options like the ListView border styles. These will only show during runtime.
'
'-(Bug fix) SetFocusOnFiles/SetFocusOnDropdown were having focus invisibly taken
'           by something; all visual indicators showed proper focus but keypress
'           would move focus to other controls. Fixed by setting an API timer to
'           execute the focus change after a 10ms delay.
'
'-(Bug fix) When using the control with another ucShellBrowse control or with a
'           ucShellTree control, an external variable had to be used to prevent
'           an infinite loop of directory change notifications and reloading; this
'           was due to a failure to implement a sanity check in .BrowserPath to
'           not proceed if NewPath=CurrentPath.
'
'-(Bug fix) A debug call on ShowShellContextMenu that shouldn't have had any effect
'           was actually causing a number of problems with icons and submenus.
'
'-(Bug fix) When compiled with the manifest from the included resource files on
'           certain versions of Windows 10, the exe would not run because the
'           manifest file was not a multiple of 4 bytes.
'
'-(Bug fix) On Windows 10, navigation into certain virtual objects was limited to
' (Partial) the first level due to different behavior of some shell interfaces,
'           a workaround was added by storing certain pidls at module level.
'           Back, forward, up, refresh, and history are all still in progress
'           and may or may not work depending on factors I haven't entirely
'           figured out yet; it's going to take a while.
'
'-(Control) Manually destroyed additional API windows and freed resources in the
'           Terminate event in an effort to prevent memory leakage.
```

*Update (Rev1)* - Error in StartNotifyOnCurPath fixed

*UPDATE:* File removed. Final version of 6.0 has been released, download it up top..

----------


## yokesee

hello good I found an error in StartNotifyOnCurPath
next without for



```
    Dim i As Long
    For i = 0 To UBound(uPidlStore)
        If uPidlStore(i).sPath = sRegPath Then
            If uPidlStore(i).pidlFQ Then
                pidl = uPidlStore(i).pidlFQ
            Else
                Exit Function
                'Failed to get a pidl and if we leave it at zero we'll get notifies for the whole filesystem
            Exit For
        End If
    Next i
```

to


```
    Dim i As Long
    For i = 0 To UBound(uPidlStore)
        If uPidlStore(i).sPath = sRegPath Then
            If uPidlStore(i).pidlFQ Then
                pidl = uPidlStore(i).pidlFQ
            Else
                Exit Function
                'Failed to get a pidl and if we leave it at zero we'll get notifies for the whole filesystem
            End If
        End If
    Next i
```

a greeting

----------


## fafalone

Fixed.

Sorry about that, no idea how that got changed between the test compiles and zipping it  :Blush:

----------


## IliaPreston

Hi.
Let me first thank you for all this.
Also, sorry I am getting back to you with a delay of a few days, because I have been busy with other things and didn't check this thread since Monday.

Anyway, the new version that you posted as *UCSB6-RC2-Rev1.zip* definitely solved the focus problem (enter-arrow key-enter-arrow key).
Also, I replaced the Res file that was attached to my vbp project with the new one in this new *UCSB6-RC2-Rev1.zip* and I just cut a new executable and the exe file also works fine.

Some notes and thoughts:

1- the Res file in the new *UCSB6-RC2-Rev1.zip* file is named *resImagesStd6.RES* with the version number (6) being part of the file name.
I think it would be probably better if the file names always remained the same, so that with any release, the new version of each file would simply overwrite and replace the older version.
With this new Res file in this new *UCSB6-RC2-Rev1.zip* package, I actually removed the existing  Res file from my vbp project, and added the new Res file.
It would be better if the file names were the same so that an overwrite would simply replace.
On the other hand, I understand that this was probably a temporary release to see if the issues are fixed or not, and that you probably yourself were going to have fixed file names in the main release.
So, my point in here may be unnecessary.
However, it doesn't hurt to say it anyway.
2. The first post in the main thread still has the *ucShellBrowse53.zip* (released march 09, 2019) and that could cause some confusion for somebody who comes across ucShellBrowse for the first time.
But, again, as I said, this UCSB6-RC2-Rev1.zip may just be a temporary release, and in that case my comment on this matter too may be unnecessary.

3. In my own notes I had specified two things to do with each new release of ucShellBrowse:



> Change this: Private Const dbg_PrintToImmediate As Boolean = True -- Change it to False to stop debug printing
> *Set the 'BackButton' property to 2-SBBK_ThemeButton*.


With this new *UCSB6-RC2-Rev1.zip* I easily did the first task before any testing.
But, the second task I don't know how to do, because ucShellBrowse now has different looks at design mode in VB6 IDE, so, how can I change that property of the BackButton?
Not very important. Just curious as to how to do this. If it is not possible, then it doesn't matter.
4. It is a while that those two strange errors don't happen any longer (A. Out of memory error and B. Unhandled window error), so, it is a good thing.

5. It is a very good thing that we have this in the code:


```
Option Explicit
Private Const mVersionStr = "ucShellBrowse 6.0.1-RC2"
Private Type HistPidl
    sPath As String
    pidlFQ As Long
End Type
```

So, at first glance, the developer can easily make sure that he has the latest version.
Thanks for everything.
Ilia

----------


## fafalone

1) Fair enough, it was mainly to keep track of things myself but I'll leave the old filenames for the final release.

2) Finalizing it now, should update tonight.

3) It's always a good idea to read the release notes when there's an update like that, I write all that for a reason you know  :big yellow: 



> ```
> 'New in v5.3 (Released 08 Mar 2019)
> '-There is now a Forward button in addition to the Back button. The 'BackButton'
> ' option has been replaced with the 'NavigationButtons' option, which provides the
> ' same options; hidden, standard buttons, or themed buttons.
> ' Additionally, right-clicking either of the buttons will display the history as a
> ' menu where you can pick any item to navigate to (current location is in bold).
> '
> '-The themed back (and now forward) button now have the option to be placed in the
> ...


4) Good news, though I'm not sure what I did that fixed it, unless maybe it was after running and exiting a few times and the new cleanup routines got it.

5) You can always check that at runtime as well, Ctrl+Shift+P on the ListView displays that, as well as whether ComCtl6 is enabled, the DPI-scaling factor, and a couple other data points.

----------


## Bobbles

I still use XP Pro SP3 for 95% of my PC usage because it is faster on an old PC.
 (And it also ensures that my VB6 creations will work on XP and later).

What say all us XP users set up a fundraising page to be shared amogn our VB6 experts who offer solutions that don't need Vista or higher.

----------


## fafalone

My project is a new generation of previous shell browsers, such as Brad Martinez's VBExplorer/EnumDeskVB, in order to demonstrate new capabilities only available on Windows Vista and above. It's not an arbritary restriction, I didn't pick Vista+ APIs just for the hell of it, but once I was going to implement the new features, it also makes sense to do everything else according to the latest methods. (And among all my other projects, they also either demonstrate something only available in Vista or sometimes higher, or are in fact XP-compatible or trivially made to be, with how noted. The whole idea of oleexp, and its demo projects, was that I looked at all the cool shell interfaces that had been introduced in Windows XP, and then saw that tons of even cooler ones had been introduced mainly in Vista, but there was a complete lack of sample code showing how to use them, like there was for the XP set.)

If you want an XP-compatible shell browser, I'd be happy to send you those excellent projects (since Brad's site disappeared a few years ago but I have a site archive). But that's not my thing.

For everyone else, I've *finalized Version 6.0*, with all the bug fixes of the last RC and several more that I ran into that delayed finalizing it. Download up top!
NOTE: ResImagesStd.res has changed, make sure you replace your old one.

The only major issue is that on Windows 10, I got straight-in navigation to work on previously problematic virtual devices, but Back/Fwd/Up/Hist are still mostly broken. I'm going to have to come up with a whole new navigation system to address that, and didn't want to hold back the release in the mean time.
Full changelog:


```
'New in v6.0
'-Added an optional Search Box to the control box. You can type in a search string,
' press enter, and it will search the current folder and its subfolders, then use
' the Custom File Set functionality to display the results. Includes Enable prop
' to control whether it appears on the View menu, and Ctrl+F keyboard shortcut to
' set focus on it if present.
' Note: Running a search will replace any existing custom file set you previously
'       loaded; the search counts as a custom set and currently only one custom set
'       is supported.
'
'-Main control border styles now include non-standard Thick/Thicker (resizable)
' options like the ListView border styles. These will only show during runtime.
'
'-If loading a folder failed, an empty directory would be brought up, and if the
' failure was from a now-deleted item from the dropdown, that would change as well
' Now, the browser will display an error and remain in the current location if
' nothing is going to be loaded.
'
'-Debug logging to a file has now been implemented. This most importantly allows
' complete logging from a compiled .exe. See the User Consts section below this
' changelog to enable/disable it and set some configuration options for it.
' Also, the sample logger included, cLog.cls, did not support Unicode. Unicode is
' now supported for both the file name and the contents.
' The log can also be activated/deactivated at runtime using the .LogActive property.
'
'-(Bug fix) SetFocusOnFiles/SetFocusOnDropdown were having focus invisibly taken
'           by something; all visual indicators showed proper focus but keypress
'           would move focus to other controls. Fixed by setting an API timer to
'           execute the focus change after a 10ms delay.
'
'-(Bug fix) When using the control with another ucShellBrowse control or with a
'           ucShellTree control, an external variable had to be used to prevent
'           an infinite loop of directory change notifications and reloading; this
'           was due to a failure to implement a sanity check in .BrowserPath to
'           not proceed if NewPath=CurrentPath.
'
'-(Bug fix) A debug call on ShowShellContextMenu that shouldn't have had any effect
'           was actually causing a number of problems with icons and submenus.
'
'-(Bug fix) When compiled with the manifest from the included resource files on
'           certain versions of Windows 10, the exe would not run because the
'           manifest file was not a multiple of 4 bytes.
'
'-(Bug fix) A while back, the UserControl_Show code was moved to pvCreate and then
'           called from the UserControl_ReadProperties method. This created an issue
'           where RaiseEvent did not work from pvCreate or UserControl_Initialize,
'           most critically preventing startup debug messages from being logged in
'           the compiled .exe. The new internal logger described above corrects this.
'
'-(Bug fix) On Windows 10, navigation into certain virtual objects was limited to
' (Partial) the first level due to different behavior of some shell interfaces;
'           a workaround was added by storing certain pidls at module level.
'           Back, forward, up, refresh, and history are all effected by this issue
'           as well, and I haven't been able to come up with an effective workaround.
'           Straight-ahead navigation is working, but Back/Fwd/Up/Rfr/Hist rarely
'           will work. Will have to write whole new navigation system.
'
'-(Control) Manually destroyed additional API windows and freed resources in the
'           Terminate event in an effort to prevent memory leakage.
'
'-(Known Issue) When you add a new instance of the control, the 'Status' text of the
'               statusbar may appear up top, but it appears normally when you run the
'               program, or close/reopen the form, and then is permanently correct.
'
```

----------


## Bobbles

> My project is a new generation of previous shell browsers, such as Brad Martinez's VBExplorer/EnumDeskVB, 
> 
> If you want an XP-compatible shell browser, I'd be happy to send you those excellent projects (since Brad's site disappeared a few years ago but I have a site archive). But that's not my thing.


fafalone,Thanks for replying.
I was not sure if the   "But that's not my thing" at the end of the sentence, cancelled out the offer at the beginning of the sentence.
If there is an offer, that would be appreciated.
Thanks,
Rob

----------


## fafalone

I meant was developing XP-compatible projects wasn't really my thing. Of course I'll send you Brad's projects.

----------


## MountainMan

I tried to compile ucShellBrowse into an .OCX like you describe in your first post but I get a compiler for an undefined variable/procedure IsIDE in line 8789. I looked in your demo projects and each has a function IsIDE which is why they compile. It is pretty obvious what IsIDE is for but when attempting to compile usShellBrowse.ocx it doesn't have any of these demo installation modules to help out by defining the function. Any easy fix for this? Thanks.

----------


## fafalone

Sorry about that. Just copy/paste the IsIDE function into the UserControl (somewhere before the last 13 procedures; the current last 13 must stay the last 13, but anywhere above those is fine). 


```
Private Declare Function GetModuleFileName Lib "kernel32" Alias "GetModuleFileNameA" (ByVal hModule As Long, ByVal lpFileName As String, ByVal nSize As Long) As Long
Private Function IsIDE() As Boolean
   Dim buff As String
   Dim Success As Long
   
   buff = Space$(MAX_PATH)
   Success = GetModuleFileName(App.hInstance, buff, Len(buff))
   
   If Success > 0 Then
     'Change the VB exe name here as appropriate
     'for your version. The case change ensures this
     'works regardless as to how the exe is cased on
     'the machine.
      IsIDE = InStr(LCase$(buff), "vb6.exe") > 0
   End If
End Function
```

That's the only function you need to copy in, the demo module is just for the demo project, and this was just an oversight as I forgot to test-compile the OCX for this sub-version.
--
*Project Updated to 6.1* - In addition to wanting to fix this bug, I made some major improvements in the Win10 virtual device issue. Didn't think I'd get so much done so fast, but between that and this bug, updating again this soon was worth it. The navigation should generally work in all scenarios now; let me know if where it's still not working. 


```
'New in v6.1
'-Substantially improved virtual device navigation on Windows 10. Up and Refresh
' should always work, Back/Forward should normally work, and infotips now work (on
' files only, folders apparently do not support them).
'
'-The graphical percent free progress bar (if enabled) is now auto-added wherever
' it's likely to appear, instead of just Computer, since it also appears in attached
' devices like phones showing their internal storage. This is done by checking if it
' also has a Free Space column, I don't think that would appear without the other.
'
'-(Bug fix) IsIDE was accidentally being called from the demo module, so an error
'           occured in a project without it. It's now been added to the .ctl.
'
'-(Bug fix) The Forward button was not disabled if you created a new end of the
'           history list by going back then going to a new location.
```

----------


## IliaPreston

Thanks a lot for the new version.

There are a number of bugs that I had not noticed earliaer (they probably existed in older versions, and they continue to exist in 6.1.0):

1. I have added a commandbutton to select a file (if the user navigates elsewhere on the form and wishes to move back to ucShellBrowse).
The commandbutton is called "cmdSelectFile" and its caption is "Select File".
The reason for this is that I want the user to press Alt+F to set focus to the file again.
Here is the code:


```
Private Sub cmdSelectFile_Click()
   On Error Resume Next
   ucsProcFiles.SetFocusOnFiles
End Sub
```

Most of the time it works fine. The user presses Alt+F and the file that he had earliaer selected and now has a dim gray rim, receives focus and will have a light blue rim (indicating that the focus is back to that file).

However, this malfunctions in two different scenarios:
A. If there was no file selected (for example in the beginning when the form loads and ucShellBrowse loads), and then the user presses Alt+F, the focus is PROBABLY set to something else, because if the user then presses the LEFT arrow key, then ucShellBrowse navigates to another folder!!!
This is an unwanted navigation.

B. There are a number of video files in ucShellBrowse, and the user selects one of them and presses carriage return. The following code kicks in and plays the video:


```
Private Sub ucsProcFiles_FileExecute(ByVal sFile As String, siFile As oleexp.IShellItem)
   Call cmdFileProcessMain_Click
End Sub

Private Sub cmdFileProcessMain_Click()
   Dim Main_File_Path       As String
   
   Main_File_Path = ucsProcFiles.BrowserPath & ucsProcFiles.SelectedFile
   CreateObject("Shell.Application").ShellExecute Main_File_Path, , , "open", SW_SHOWNORMAL

   ucsProcFiles.SetFocusOnFiles
End Sub
```

Then the user closes the video player.
At this time the video file in ucShellBrowse appears with a gray rim (this is probably another bug: The last line in cmdFileProcessMain_Click didn't work, but that is another issue).
Then the user presses Alt+F and the "Select File" commandbutton kicks in and correctly sets the focus back to the video file that the user played (that file will then have a light blue rim).
But, then at this time if the user presses the left arrow key, ucShellBrowse navigates to another folder instead of moving to another file in the existing folder!!! 
Again, this is an unwanted navigation.
Can this be fixed please?
Or, is there a workaround that I could use to avoid this unwanted navigation?
If anybody knows of a workaround that I could use to prevent this unwanted navigation, I would appreciate it if they would share it with me.

2. There is a combobox within ucShellBrowse that shows the current folder.
If I click the tiny downward triangle to its right in order to drop it, it drops but then it IMMEDIATELY un-drops!
It does not stay dropped.
If I repeat that, the problem persists.
There is no way to drop that combobox and make it stay dropped by mouse.
However, when this combobox drops and immediately undrops, I can use the keyboard (Alt+DownArrow) to drop it, and in that case, it stays dropped.
This is a little bit annoying.

3. I have set the Enable ShellMenu to False. 
So, the right-click on a file does not produce that pop-up menu.
However, when the form first loads, and I double-click on a file for the first time, it gives me the properties page:
https://i.imgur.com/bEuwGqU.jpg
If I double click one more time, it opens the file in a video player (expected behavior), but the very first double-click shows this unwanted properties page.

4. Last but not least:
As I was playing around with the new version of ucShellBrowse (6.1.0), I suddenly saw something bizarre:
https://i.imgur.com/lVd3kUF.jpg
At first when I downloaded version 6.1.0 (an hour ago), it was quite good, but after an hour of working with it, the above bizarre behavior happened.
I closed VB6, and re-opened it, and it looks fine again.
Strange! I don't know why this happened and I don't know why it went away.

Any help on these issues would be greatly appreciated.
Regards.
Ilia

----------


## IliaPreston

Another issue:

5. If I set the ucShellBrowse1.ItemFilter to just one file name, then ucShellBrowse1 shows the file's icon, but not the thumbnail.

Example:
This code:


```
Private Sub Form_Load()
   Me.Show
   DoEvents
   ucShellBrowse1.Visible = False
   
   ucShellBrowse1.ViewMode = SB_VIEW_THUMBNAIL
   ucShellBrowse1.FileDragDropMode = SBDD_Disabled
   ucShellBrowse1.HeaderDragDrop = False
   
   ucShellBrowse1.BrowserPath = "C:\MyFiles\MyVids\Music\Classical-Music"
   
   ucShellBrowse1.Visible = True
End Sub
```

Results in this:
https://i.imgur.com/NOAwYSq.jpg

But if I add the filter and RefreshView:


```
Private Sub Form_Load()
   Me.Show
   DoEvents
   ucShellBrowse1.Visible = False
   
   ucShellBrowse1.ViewMode = SB_VIEW_THUMBNAIL
   ucShellBrowse1.FileDragDropMode = SBDD_Disabled
   ucShellBrowse1.HeaderDragDrop = False
   
   ucShellBrowse1.BrowserPath = "C:\MyFiles\MyVids\Music\Classical-Music"
   ucShellBrowse1.ItemFilter = "D.Scarlatti - Fandango.mp4"
   ucShellBrowse1.RefreshView
   
   ucShellBrowse1.Visible = True
End Sub
```

The result is this:
https://i.imgur.com/uxnC43r.jpg

Is there any workaround?
Is there something that I could do to get it to show the thumbnail?

Thanks.

----------


## fafalone

1) Will take a look at it; a lot of focus issues are difficult if the ListView isn't already focused; this is easily fixable for UC's that only have a single focusable item, but I don't know how to modify that code to correctly focus on multiple objects. Will look for a specific workaround though.

2) Definitely will need full version info for your current Win10 version; because that I've tested on 7, 8, and 10. I do recall a bug like that in a much earlier version, but ever since I started working on the virtual device issue I've done a lot of development on Win10, and definitely used the dropdown all the time while working on the 6.x versions. 

3) Really it shouldn't be doing either of those things unless you're doing it yourself from the event a double-click raises. Will take a look.

4) That's an issue with VB, where the code or something in memory about the UC has changed while Design View is open. You don't need to re-open VB, just the form. 

5) Will try to replicate. Does this not occur if the filter is off? 
If that's the case, #1 guess is that some problem is occuring by the immediate double-refresh (when you set an item filter that way, it reloads the current folder to apply it, as opposed to the other filter mechanism which doesn't). Have you tried just setting .ItemFilter? The refresh shouldn't be needed.

I was going to say to use the other filter, but apparently I inadvertently broke manual application of it somehow :/ The filter bar still works, until I update .FilterBarApplyManually can be fixed by adding the following to the start of GetFilterText:


```
If sManualFilter <> "" Then
    GetFilterText = sManualFilter
    sManualFilter = "" 'or else a future typed filter would get overridden
    Exit Function
End If
```

Other suggestions until I can replicate, if .RefreshView is really needed, try a DoEvents before it. Switching out then back into thumbnail view, with DoEvents in between, might also work, but probably not.

----------


## IliaPreston

> 1) Will take a look at it; a lot of focus issues are difficult if the ListView isn't already focused; this is easily fixable for UC's that only have a single focusable item, but I don't know how to modify that code to correctly focus on multiple objects. Will look for a specific workaround though.
> 
> 2) Definitely will need full version info for your current Win10 version; because that I've tested on 7, 8, and 10. I do recall a bug like that in a much earlier version, but ever since I started working on the virtual device issue I've done a lot of development on Win10, and definitely used the dropdown all the time while working on the 6.x versions. 
> 
> 3) Really it shouldn't be doing either of those things unless you're doing it yourself from the event a double-click raises. Will take a look.
> 
> 4) That's an issue with VB, where the code or something in memory about the UC has changed while Design View is open. You don't need to re-open VB, just the form. 
> 
> 5) Will try to replicate. Does this not occur if the filter is off? 
> ...


Issue #1 (that I mentioned in in post 64) is actually two different problems:
A.	The focus issue ()
B.	Unwanted navigation. User uses arrow keys (and no other keys) and this results in navigating  to other folders!!! instead of navigating among the files of the current folder. (I explained it in detail already in post #64 and provided two examples)
The issue of unwanted navigation is far more serious than the focus problem. Arrow keys should not take the user to other folders.
Issue #2:	My Windows is always up to date. I always install new updates.
Here are the full details:
	Edition: Windows 10 Home
	Version: 1809
	Installed on: 2018-12-21
	OS build: 17763.503 
Issue #3:	No, I definitely don't do it via the DblClick event of ucShellBrowse or in any other way. 
I have not placed any code in the DBlClick event of ucShellBrowse. That event function is empty

Issue #5:	This problem happens only when the .ItemFilter property is set
Even if I remove the refresh line:


```
ucShellBrowse1.RefreshView
```

This problem still happens.
Even if I remove Me.Refresh, this problem still happens.
Even with a DoEvents before RefreshView, this problem persists.
Even if I remove the RefreshView and keep the DoEvents in place, the problem persists:
https://i.imgur.com/uxnC43r.jpg

However, this problem happens only when my filter limits the resultset to only one file. (good example in post #65 above).
If my filter identifies multiple files, the thumbnails show properly.
For example, this code works fine (whether or not .RefreshView is used):


```
   ucShellBrowse1.BrowserPath = "C:\MyFiles\MyVids\Music\Classical-Music"
   ucShellBrowse1.ItemFilter = "T*.*"
```

----------


## fafalone

*Note*: I sent you a PM with link to a .ctl version that implements all the below temp fixes.


I believe I have found the bug responsible for #5. ImageList_Add returning 0 is valid and was not being recognized as such.

Until the next version update, you can fix it like this:
-Go to the AddThumbView2 function in ucShellBrowse
-Near the top of that function, in the m_ThumbExt block, there's the following line:
            If (lIdx > 0) And (lIdx < 999999) Then
Change it to
            If (lIdx >= 0) And (lIdx < 999999) Then

and that's it. No other changes to your original code are required. I was able to replicate the bug and this seems to have fixed it without any immediately apparent side effects.


As for the rest, I'm having a lot of trouble replicating them. I'm going to track down the exact version of Win10 you have, but the one I've been testing on, on my laptop, isn't much different, so it's hard to imagine what's going on.

For #3, it wouldn't be the double click event itself, it would be the FileExecute event, which you've indicated you do have code for. The only way the Properties window could be brought up is if it detected the Alt key was down. 
You can examine if that's the case, in ucWndProc it's handled by


```
            Case NM_DBLCLK, NM_RETURN
                If tNMH.hWndFrom = hLVS Then
                    DebugAppend "Got dblclk/ret"
                    If GetAsyncKeyState(vbKeyMenu) Then
                        ShowSelFileProps
                    Else
                        LVDoubleClick ListView_GetSelectedItem(hLVS)
                        RaiseEvent FileExecute(sSelectedFile, siFocus)
                    End If
                End If
```

but I can't currently replicate it, so if you could set a breakpoint or debug statement to see if it's thinking Alt is pressed, that would at least be a clue... as to why it would think that if you haven't pressed Alt, well that's a whole other problem.


---
For #1, the navigation issue stems from a focus issue. The only way I can figure out for making a left arrow navigate, is to set the ComboType to SBCT_DropDownList, and then specifically set focus on the combo, either by clicking it, or .SetFocusOnDropdown. I can't figure out how to focus on that instead of the ListView unintentionally. But if the Combo does have (legitimate) focus, then you would in fact want it to respond to the keyboard. But the left arrow is redundant, as it only goes up and down.

As an interim solution until we can get a better handle on what's going on, you can block navigation triggered by a left arrow press to the combobox:
In CBWndProc, immediately after the Case CBN_SELCHANGE line, add the following:


```
                If GetAsyncKeyState(VK_LEFT) Then
                    DebugAppend "CBSelChange::Block LeftPress"
                    Dim lSel3 As Long
                    'First undo text change
                    lSel3 = SendMessageW(hCombo, CB_GETCURSEL, 0&, ByVal 0&)
                    SendMessageW hCombo, CB_SETCURSEL, lSel3 + 1, ByVal 0&
                    'Now cancel action
                    bHandled = True
                    lReturn = 1
                    Exit Sub
                End If
```


--------------
For Issue #2, tried everything I could think of and couldn't get it to not drop down. Hooked up an actual mouse instead of the trackpad, same deal, stayed down every time. 

A possible temporary mitigation, add a sanity check on the time between dropdown and close up, and if it's only a few ms (faster than a human could click again to roll it up), re-open it programmatically-- I don't know if that message will keep it open for you though.

At the very top of the .ctl, in the module-level declares, add 
Private cbSanityCheck1 As Long, cbSanityCheck2 As Long


Then in CBWndProc, just delete the existing CBN_CLOSEUP block, replaced with


```
            Case CBN_DROPDOWN
                DebugAppend "CBD->Dropdown"
                cbSanityCheck1 = GetTickCount()
            Case CBN_CLOSEUP
                DebugAppend "CBD->Closeup"
                cbSanityCheck2 = GetTickCount()
                If Abs(cbSanityCheck2 - cbSanityCheck1) < 10 Then
                    DebugAppend "CDB::SC Fail"
                    SendMessageW hCombo, CB_SHOWDROPDOWN, 1&, ByVal 0&
                    Exit Sub
                End If
```

You might need to tweak the timing; the above is at 10ms.

----------


## IliaPreston

Thanks again for ucShellBrowse.
With *ucShellBrowse 6.2.1, Pre-release with temp mitigations*, most of the issues have been resolved.
However, a few small issues remain (The numbers below are new. They do not follow the list of issues specified in previous posts):

1. When I start my test vbp project, and (without clicking on any file thumbnail) press Alt+F (to invoke the "Select &File") commandbutton, it no longer causes the next keystroke (LeftArrow) to perform an unwanted navigation. The next keystroke (whether LeftArrow or any other arrow key) sets the focus to the first thumbnail (instead of an unwanted navigation). So that is good.

But, the Alt+F *ITSELF* (even before I press LeftArrow or any other arrow key) is supposed to set the focus to the thumbnail because there is this event function:


```
Private Sub cmdSelectFile_Click()
   ucShellBrowse1.SetFocusOnFiles
End Sub
```

When I press Alt+F, the thumbnail does NOT show a light blue rim. It shows absolutely no rim at all not even a gray one.
But, then when I press an arrow key, the thumbnail will show a light blue rim, and I can see that the thumbnail genuinely has focus (because then pressing Enter will execute the file, or alternatively, pressing other arrow keys will highlight adjacent thumbnails).
This is a very small issue, because when I press Alt+F and it does not set the focus to the thumbnail, I can simply press an arrow key to achieve that, but still Alt+F itself is supposed to do this and it doesn't.

2. The other commandbutton called "&Process Selected File" has this code associated with it:


```
Private Sub cmdFileProcess_Click()
   Dim Main_File_Path       As String
   
   Main_File_Path = ucShellBrowse1.BrowserPath & "\" & ucShellBrowse1.SelectedFile
  'CreateObject("Shell.Application").ShellExecute Main_File_Path, , , "open", SW_SHOWNORMAL
  'MsgBox "Selected item not found:  " & ucShellBrowse1.SelectedFile, vbOKOnly, "Process"

   ucShellBrowse1.SetFocusOnFiles
End Sub
```

Please note that two lines in there are commented out.
Here is how to recreate the problem:
Step 1: Uncomment only the MsgBox. Then run the application. Select a video file (for example by clicking on it). Press Alt+P in order to invoke the above code. The messagebox appears. close the messagebox. 
Result: The application sets focus to the thumbnail that you had initially selected. This is good and expected behavior.

Step 2: Comment the Msgbox again, and instead, uncomment the CreateObject line. Then run the application. Select a video file (for example by clicking on it). Press Alt+P in order to invoke the above code. The video plays in its default video player. Close the video player.
Result: The application does NOT set focus to the thumbnail that you had initially selected. This is the problem.
3. When I set the following constant to False:


```
Private Const dbg_PrintToImmediate As Boolean = False
```

most of the debug info (almost 100% of it) will be suppressed.
But still the following two lines are printed when the application starts:


```
-->UC_INIT_OUT
-->PvCreate
```

And the exact same two lines are printed when the application terminates (so, 4 lines in total).

4. I have a feeling (not 100% sure though, just a feeling) that there could be some memory leak and/or unhandled window problem (Invalid window handle) in ucShellBrowse.
I experienced them earlier and reported both of them in this thread (post# 46). (in that post: problems 1 and 2)
I haven't encountered them recently (except just once), but, it is also worth mentioning that recently, I haven't tested ucShellBrows as much as I had tested it earlier.

Something caught my attention though:
In another unrelated thread (http://www.vbforums.com/showthread.p...n-a-Picturebox) 
In post#19 of that thread you said something:



> Did you change the picturebox's AutoRedraw property to True? Probably want to change ScaleMode to vbPixel as well. These are on the design-time Properties box like where the Name is.
> 
> And also see the SetPreviewPictureWithHBITMAP function that's setting it in my code?
> 
> 
> ```
> picturebox.Cls
> hBitmapToPictureBox picturebox, hBmp
> picturebox.Refresh
> ...


I have a feeling that this could have something to do with the memory leak or the unhandled window problem (Invalid window handle).
I don't have very strong proof for that. It is just a hunch.
But, it is probably worth investigating.

Thanks.
Ilia

----------


## fafalone

1) This is by design. It restores focus to the file list; but if no item previously had focus, it won't focus a specific item because the user has not picked a file to be focused. I could write a separate function to set focus on a specific file, but wouldn't want to presume the user wants any specific item focused when it wasn't already.

2) You're launching an external application; that's going to take focus. The code doesn't wait for the launched application to exit, so SetFocusOnFiles fires before the external window takes focus. The MsgBox does stop code execution, so it's gone when you reset focus.
You'd have to detect the focus loss and steal focus back from the launching application, then reset file focus.

3) Will be fixed with the update soon, in the mean time you can just search for those two strings and replace Debug.Print with DebugAppend.

4) I'll take a look into it. The preview frame/picturebox are regular VB windows though, not API created. Still haven't encountered that error myself though; no idea on a specific set of steps to reproduce it reliably? 
Were all the times the error happened when the preview pane was enabled?

----------


## fafalone

*Project Updated to 6.2*

This version adds a few minor features, and fixes all the bugs identified in Post #64, and what could be done with #69:

1-Added Optional args to SetFocusOnFiles to highlight first folder or file
2-Impractical to fix/expected behavior
3-Fixed
4-Identified a couple more potential leakage points that might be relavent, hopefully the crashes become even rarer (I've still never encountered one on any OS). 

Here's the full changelog:


```
'New in v6.2
'---NOTE--- This control has a number of keyboard shortcuts, please remember that
'           the ListView must have focus to use them... However, if the host form
'           has the same shortcut, the command will go to the form even if the
'           ListView is focused.
'
'-Status updates are now given during a file search with the current folder which
' is being searched.
'
'-Added optional Destroy flag for SetPreviewPictureWith___ functions.
'
'-Added option PreviewVideoAsThumb, which forces videos to display a thumbnail as
' its preview in the Preview Pane, instead of loading the regular preview handler,
' which typically loads an instance of a video player to play the first few seconds;
' this might be slow, and a static image might be preferable. Off by default.
'
'-The Search Box toggle will no longer appear on the View menu if the control is in
' Files Only or Drives Only mode.
'
'-Handling for WM_UNICHAR/WM_IME_CHAR
'
'-By request, SetFocusOnFiles now has an optional parameter that will set focus to the
' first item if no item was previously focused, and a second option to specify if that
' first item must be a file and not a folder.
'
'-(Bug fix) If the shell context menu was disabled, it would also prevent the View menu
'           from popping up on a background click even if it was enabled.
'
'-(Bug fix) FilterBarApplyManually was not working.
'
'-(Bug fix) In Thumbnail View, the thumbnail for the first file loaded in a folder
'           was not being generated in some circumstances (it fell back to the normal
'           file type icon).
'
'-(Bug fix) With previews, there may have been a memory leak due to not freeing a
'           pointer to GlobalAlloc memory before reassigning it or exiting app.
'           Potentially related to mysterious crashes as well.
'
'-(Bug fix) If you enabled one of the control box items while the control box was
'           disabled, it would show the control box anyway, and in the wrong spot to
'           compound the problem. Now, enabling a control box item won't show the
'           control box, but the setting change is made and will be reflected if you
'           re-enable the control box.
'
'-(Bug fix) Pressing the Alt key while the host form has focus, then setting focus
'           onto the control, resulted in it being like the Alt key was held, leading
'           unintentional commands being performed.
'
'-(Bug fix) Under some particular Windows 10 versions and/or circumstances, the ComboBox
'           would not stay down. To prevent this, in CBWndProc I added a sanity check to
'           block a closeup if the box had been opened in the previous 10ms (i.e. much
'           faster than a human could be doing it). This doesn't seem to cause any issues
'           but if it does let me know.
```

----------


## fafalone

*Version 6.3 Released!*




*IMPORTANT:* This version requires you to update your oleexp.tlb version to v4.6 or higher.

The main update in 6.3 is a new search system based on Structured Queries... I put out a separate demo of this technique here:
[VB6] Using Structured Queries to conduct a Windows Search by any property
There's a new popup window (double-click the search box, or in a mode without the control box, the view menu pops up that box with a textbox added) and that has some more options, and you can use the new ExecFileSearchEx function to supply your own ICondition object. Besides the additional speed and power, this method actually creates a results folder as part of the file system, so you can run multiple searches and still see the old ones, and it no longer takes up the 'Custom Set' feature so you can still have one of those.
Note that if you're using this control with ucShellTree, you'll need to update to ucShellTree v2.13, released the same day as this project, in order to be able to navigate back to the search results folder after leaving one. Older versions have a design issue that only allowed them to be added, not recreated for passing back (the results item lacks a relative pidl, and the full one wasn't previously stored).

Apart from that, all the fixable bugs in the Known Issues section were fixed, and some other bugfixes as well, and a couple small feature updates. Here's the full changelog:


```
'New in v6.3
'
'-There's a new method of searching. This method is much more powerful and uses
' the ICondition/ISearchFolderFactory system. You can now have multiple search
' result sets added as folders, and you can go back to the old ones during the
' current session (of the program). You can additionally specify your own search
' to conduct.
'--Double-clicking the search textbox brings up a small pane with additional search
'  options, including size, type, and date. You can use any or all given options,
'  including leaving the original textbox blank if you choose.
'  The 'Kind' list is automatically populated with all valid values of the current
'  OS version.
'--The background color of the options popup is inherited from the main UserControl
'  background color; but you can force it back to the default gray with the
'  bSearchOptionsInheritBkColor User Const.
'--This new method does not use the Custom File Set functionality, so you can have
'  one of those and searches don't count as it (but you can still only have one of
'  those, no changes have been made on that front).
'--Searching is now supported even if the Control Box isn't visible (disabled or the
'  control is in Files Only mode). The options popup appears with an added textbox
'  for the search query. This option will not appear if the search box is disabled.
'--Finally, you can execute a custom search by passing a locations and conditions
'  object to ExecFileSearchEx. The old ExecFileSearch is still there and the
'  arguments unchanged, but now utilizes the newer method.
'--NOTE: While the folder will be added to an accompanying ucShellTree, as of this
'        release it can not be browsed back to from one; the other control will
'        need to be modified to support doing this, but the supporting changes to
'        this control have already been made (you can pass a string or shell item
'        with the full parsing path as 'Folder Search n'
'        Post-Edit: ucShellTree updated, grab 2.13 or higher for browsing fix.
'
'-Added BrowserPathPidl Property Get/Let so you can get the current pidl or open
' a path by a pidl. Fully qualified pidls only.
'-Also added BrowserPathItem Property Get for the current path IShellItem; there's
' no Let here as there's already BrowserOpenItem to navigate to an IShellItem.
'-Updated BrowserOpenItem to not reload current path and to just load the folder's
' drive if in Drives Only mode; this behavior is now consistent with .BrowserPath
'
'-The DirectoryChanged event now reports the fully qualified pidl of the new path.
'
'-The 'More...' command in the Column Header menu to choose all the columns to show
' will now be disabled if the column select popup is already visible; this prevents
' an error stating 'This window has already been subclassed.' from being shown on a
' second click, as well as some internal issues.
'
'-Rating stars are no longer applied in the view when the underlying file does not
' support them, including both the mouseover effects and changing if clicked.
'
'-In Design Mode, the size, type, and date columns are now also filled in with some
' temporary variables.
'
'-(Bug fix) Somehow somewhere in the last few versions a line mysteriously vanished
'           from SetFileRating2 and it stopped working.
'
'-(Bug fix) Under some circumstances in LVLoadFolder where sPath was blank, it would
'           also set m_sCurPath to blank, breaking, among other things, the ability
'           to create a new folder.
'
'-(Bug fix) When you navigated from one location with Percent Full progress bars to
'           another (e.g. Computer to attached phone), the progress bar showing the
'           percent would be drawn in the wrong column, with the right column there
'           and left blank.
'
'-(Bug fix) If you grouped by Type, then switched to another grouping, then switched
'           back to type, no items would be shown.
'
'-(Bug fix) Clicking on the search box caused the caret to jump back to the beginning.
'           This was done because of the only way that works to set focus for the
'           Enter button (or Enter would go to the last control focused even though
'           every other key went to the textbox), but now I thought of a way to keep
'           the caret where it is.
'
'-(Source) Finished trimming ListView_ macros, all unused ones have been removed, and
'          all simple ones have been changed and the macro deleted. All unused Header_
'          macros have been removed as well.
```

----------


## fafalone

Version 6.4 Released!
*IMPORTANT:* This version requires you to update your oleexp.tlb version to 4.61 released today (October 3rd, 2019).

Unfortunately there were some major issues with the new search feature. It didn't support ; for searches like *.txt;*.doc. This I was able to fix, however it required several additional Structured Query interfaces that oleexp.tlb didn't already have, so very sorry for the inconvenience but that will have to be upgraded again along with this version. 
Other multi-parameter search I just couldn't find a workaround for, so it's now limited to one parameter per property-- i.e. only 1 size field and 1 date field (you still still of course mix and match among name, size, type, and date using any or all of those). 

Good news is it's not just an upgrade for that, I've been really busy on this project and there's a whole bunch of new features and bug fixes. Devices and Printers, and also Programs and Features, are now on the 'Special Folders' submenu and now every ::{ path sent to or queried by the control is now checked for the shell prefix before it fails. Then there's new color options, automatic better-named categories in Computer/This PC, live-updates on the directory dropdown, and much more. 
Here's the full changelog:


```
'New in v6.4
'
'-Some virtual shell locations, like Devices and Printers, are represented by a
' GUID, ::{GUID}, but cannot be resolved by the various name parsers. HOWEVER, if
' you add the shell: prefix, shell:::{GUID}, they can now be resolved and opened.
' Various updates have been made to check for this scenario, because when the
' path is checked on these items, it doesn't include the shell:
'--Devices and Printers, and also Programs and Features, are now on the 'Special
'  Folders' submenu.
'
'-Folders like Computer have a special category system not represented in the
' details columns, information set up by an ICategoryProvider/ICategorizer system.
' Now if you enter one of these folders, that information is read and group mode
' is actived to display them in categories.
'
'-Deleted folders and disconnected drives will now be removed from the directory
' dropdown as well. Children are also removed. Note that for folders, this only
' applies to items in the current directory, as that's all that's being monitored.
'
'-Added DetailsPaneBackColor, DetailsPaneForeColor, and DetailsPaneFileName options.
' -Note: The property values in the text boxes cannot be changed; they're black.
'
'-The Column Select popup now inherits the UserControl back color and the ListView
' fore/back colors. See bColumnSelectInheritBkColor user option to disable.
'
'-Added NoNavigateOnSelect option, so that instead of navigating into a selected
' folder, that folder is treated as a selected item and the FileExecute event is
' raised. The right-click menu now has a 'Browse' option so the user can still open
' the folder if desired (subject to the LockNavigation option; this item doesn't
' appear if locked).
'
'-Added SearchBoxWidth option. Specify the width in pixels, this is then multiplied
' by the DPI scale factor.
'
'-Share overlay icon is now manually set on folders that don't already have a valid
' overlay specified.
'
'-Font scaling for high-DPI has been improved. It's now scaled by DPI/96DPI and
' rounded up if not a whole number (except for the buttons, which can handle fractions).
'
'(SEARCH ISSUES)
'-I thought you could just create multiple search conditions, like two sizes (>1KB, <10KB)
' but it turns out that doesn't work; no files are returned. I explored other ways of
' doing it that are allegedly supported, but to no avail. For the time being, I've had to
' delete the 2nd size and 2nd date search options.
' Search by name doesn't support multiple filters via the ; delimiter, but I was able to
' find a way around that, however you will need to upgrade oleexp.tlb. Sorry, it required
' a whole new set of interfaces.
'------------
'
'-(Bug fix) A FileExecute event was being raised, with a blank path and incorrect
'           IShellItem, for folders on double-click or enter pressed. No event is
'           raised now unless the new NoNavigateOnSelect option is set, in which case
'           the correct item and path are passed.
'
'-(Bug fix) If you switched to Thumbnails from folders with overlay errors, the error
'           handler was being ignored so enumeration stopped.
'
'-(Bug fix) If the current folder is Computer/This PC and a drive is removed, it
'           was not being removed from the ListView.
'
'-(Bug fix) Minor graphical glitches: Fixed gray edges around command buttons; also
'           the Bookmark button was shorter than the rest. Fixed sizing (icon not
'           fitting) and improved alignment of the Search Box.
'
'-(Bug fix) Non-default fonts weren't applied to the Forward button (when in the
'           standard mode; obviously theme buttons have no text).
'
'-(Bug fix) Under some circumstances, when the Preview Pane is enabled, the preview
'           doesn't change when a new item is clicked (unless you resized the panel
'           to trigger a refresh). This was happening after creating and clearing a
'           marquee selection box (the box you drag out to select multiple items),
'           and sometimes after right-clicks. A new trigger fixes the issue.
'
'-(Bug fix) Since all group columns besides name/size/type/dates were treated as
'           as the 'Extended' group mode, switching from one extended column to
'           another without one of the basic ones in between was ignored since
'           the main mode wasn't changing.
'
'-(Bug fix) If an item was removed, then re-added, it wouldn't get re-added to the
'           directory dropdown.
'
'-(Bug fix) Under some circumstances, the subitem progress bar for free space was
'           drawn in the wrong column, particularly the first time in attached
'           devices. Now a hard check of the position is done every time.
'
'-(Bug fix) The selected 'Details' columns were cached, but the list of them was
'           not. So if you e.g. went to Computer, then back to a folder previously
'           viewed, only the properties from Computer would be in the column select.
```

----------


## fafalone

Critical Bug Update

*Version 6.4.1 Released*
FileExecute event was not being raised in almost all circumstances.

In the last version, I eliminated an event raise that triggered it on every double click/enter press, so that it wasn't raised by navigating inside the control. However I failed to then subsequently add event raises for all the other double-click/enter press scenarios.

I apologize for this glaring oversight.  :Blush:

----------


## fafalone

*Version 6.5 Released!*

This version has a number of small behavior and performance improvements, adds the ability to rename all drive types as well as portable devices, and fixes the bug where the Special Folder menu items for Devices and Printers / Programs and Features, added with much fanfare a couple versions ago, was not working. Additionally, an item for 'Recent Places' has been added ('Recent Items' was already there, but includes files and folders, Recent Places is a hidden shell location that only displays folders). 

*NOTE:* This version requires an update to oleexp.tlb to version 4.62, which was released on 20 Oct 2019.
I promise I'll do everything possible to avoid yet another update after this; it's just the absolute only way one of the new features (renaming drives) would work was to update an interface in it.

*Full Changelog*


```
'New in 6.5
'
'-For Computer/This PC and attached devices with memory cards/drives, the second
' line of the Tile View just contained a single size/number/drive type, but
' there's a hidden property to make it display e.g. "1GB free of 10GB". This
' column is now added for Tile View (and still hidden from Details View).
'--Additionally, changing the Details View columns before setting Tile View will
'  no longer effect drive space display tiles.
'
'-Computer/This PC has renames marked enabled the standard ways (SFGAO_CANRENAME
' which enables label edit renaming, and the Rename context menu command), but
' the rename cannot be executed in the normal way: The rename must be done using
' the SetVolumeLabel API or others... this is now supported.
'--All types supporter; internal, removable, network, optical, etc.
'--Connected devices without a drive letter, like phones and cameras, are also
'  supported through the Portable Devices COM interfaces.
'
'-Minimum height was not really enforced. It's now set dependent on the sum of
' the minimum heights of enabled items (navbar, listview, details pane, status).
'
'-Resizing the UserControl will now also refresh the Details Pane and/or Preview
' Pane, on a timer with a 500ms delay after the last size change.
'
'-When Checkboxes are enabled, adjusted the check/uncheck all action that occurs
' when clicking the column checkbox so that all items are processed at once, and
' not one at a time causing a redraw and associated lag for each item.
'-That still left one scenario where it lagged: Mass-deselect without it being
' a column uncheck. To address this, the selection update itself is now subject
' to being queued. Before any update, it holds for 20ms, which is imperceptible
' for just jumping around files manually, but catches all mass-deselects.
'
'-Added 'Recent Places' to the Special Folders menu. There's already a 'Recent
' Items' entry, but that shows both folders and files, where Places shows only
' the folders.
'
'-(Bug fix) The Special Folders entries for Devices and Printers + Programs and
'           Features did not work. This was a weird oversight where I had those
'           as regular bookmarks, and the entries got their paths from those.
```

----------


## fafalone

*Version 6.6 Released*

There's a number of small behavior and feature improvements in this version, as well as some minor bug fixes. Now shows MP3 album art, has option to open to last path or to a blank display, a quick way to get any property from the selected file, status updates during large folder loads, and more.


_MP3 album art_

*Full Changelog*


```
'New in 6.6 - Released 21 Nov 2019
'
'-In Thumbnail Mode, new IThumbnailHanderFactory/IThumbnailProvider routine will
' load additional thumbnail types, most notably Album Art for MP3 files. Should
' be faster too, as a factory is created for a folder then gets passed child
' pidls, which we already had.
' Additionally, the new IThumbnailCache routine is present as fallback for above.
' These are not limited to media by default; if you want them to be, there's a
' new User Option (below this changelog), as well as an option to always use them
' even when Extended Thumbnails are not enabled (for non-extended types).
'
'-New BrowserStartBlank option allows for not opening any location on startup. The
' BrowserPath property in the IDE will be ignored, but any actual code to open
' somewhere will still be executed.
'
'-BrowserStartLastPath option will load the last path from the previous run as the
' startup path (if set and valid). This does not override BrowserStartBlank.
'
'-The path from the previous run is stored in the registry, along with the list of
' bookmarks. Previously, this was stored in such a way multiple controls and projects
' would be using 'ucShellBrowse' as the key, so there'd only be the single data set.
' Now, the key is set to ProjectFolderName.ProjectName.ControlParentName.ControlName,
' so the ucShellBrowse demo would be Demo.ShellBrowseDemo.Form1.ucShellBrowse1 -- so
' each control, even on the same form, will now have its own bookmarks and last path.
'
'-If you do wish to share bookmarks, there's a new .Bookmarks Property Get/Let, so
' that you can retrieve/set the bookmark set for a control. The format is:
' FullPath1|FullPath2|etc with the solid bar delimiter. This is not shown in the VB
' Property Browser since that would break Unicode support.
'
'-Added HeaderMinWidth option to set a general absolute minimum for header item width.
'
'-In the Details Pane, only one active editing control appears at a time now (one
' only among an active edit box, dropdown control, or datetime control). The value
' of any hidden is then displayed as text, but is not final, clicking Cancel will
' still revert it to the currently saved value.
'
'-Added DisableWhileLoading option to disable the ListView during new folder load
' to prevent causing problems by clicking on stuff before it's done loading.
'
'-Added ThumbnailScaleForDPI option (default=True) to scale main thumbnail cxy
' and framed small thumbnails to DPI scale factor
'-Added FontScaleForDPI option (default=True) to control whether the font scaling
' intoduced a couple versions ago is done.

'-Frames around small icons are now adjusted for background color luminance; they
' were hard to see on some backgrounds.
'
'-Added SelectedFileGetProperty and SelectedFileGetPropertyByPKEY. To use the
' latter with an actual PROPERTYKEY, oleexp would have to be modified such that
' you couldn't just overwrite old versions with new, you'd have to unregister,
' then register the new version. So instead, as the argument name indicates,
' you pass VarPtr(PKEY_whatever).
' The property store for the selected file is cached the first time one of these
' is called for the selected file, so subsequent calls will be quicker.
'-Also added FileGetPropertyByPKEY (by filename; FileGetProperty already exists)
'
'-When auto-adding the Percent Full progress bar, it's now inserted as the 2nd
' column like Explorer, instead of down at the end. Also adjusted spacing and fill.
'
'-Adding status updates saying 'Opening...' before starting directory load, so
' that the user knows the control isn't just frozen/doing nothing if there's a
' wait for hard drive spin-up or other delay.
' After the first 30 items, those 30 are rendered (without details) to show
' progress while the status message (in the statusbar or StatusMessage event)
' changed to 'Listing...'
' Then every 97 items a status message saying 'Listing... n' where n is the file
' count is sent (but no more redrawing as to not slow down large directories).
'
'-Added Hot Tracking options OneClickActivate, TwoClickActivate, UnderlineHot,
' and UnderlineCold, applying those ListView Extended Styles.
'
'-Added ComboHideIcons option that hides the folder icons in the directory dropdown.
' NOTE: This cannot be changed during runtime
'
'-(Bug fix) Fonts (in the font folder) were not displaying properties in the details pane.
'
'-(Bug fix) Some file types had empty, inapplicable properties listed in the details
'           pane; to address this, any property that is read only and blank is not shown.
'
'-(Bug fix) Sometimes, in an unpredictable way, Windows would send 2 SHCNE_CREATE messages
'           for the same file, resulting in 2 new entries as the existing dupe checker
'           wasn't catching them. Now it does.
'           In a somewhat related bug, if a file of the same name was deleted and then
'           pasted, it would not show up. Now it will.
'
'-(Bug fix) BrowserPathPidl should not have appeared in the 'Properties' IDE window.
'
'-(Bug fix) The AddColumnByPKEY sub was added as public last version, but you can't pass
'           a PROPERTYKEY directly like the argument called for (without it being more
'           trouble than it's worth in TLB registration issues), so it's now been changed
'           to pkey_varptr, which as the name suggests, mean you pass VarPtr(PKEY_Whatever)
```

----------


## fafalone

*Version 6.7 Released*

There's some long overdue options here, I thought it followed Explorer for hidden/superhidden, but apparently not, so added those options (Use Explorer's setting, Always Show, or Always Hide), whether the user can rename files is now optional, icons can now be removed from the dropdown instead of just the edit box, and some more minor options have been added. There's a few significant bug fixes... Windows 10 Drives Only Mode was showing a number of virtual objects that aren't drives, Search would fail if you started from the root of a Library, and then a couple minor issues-- rating star mouseover issue, and history buttons being enabled when they shouldn't be when Start Last Path was enabled.

*Full Changelog*


```
'New in 6.7.2 - Released 17 Dec 2019
'-MAJOR BUG FIX
'-BrowserPath couldn't be changed in the Properties window. Apparently it's been
' like this since v6.0. You could set .BrowserPath on Form_Load, but the default
' folder (App.Path) was still loaded beforehand, resulting in lag and a history
' entry for it.
'
'-Also fixed minor bug where the first time the status bar was shown (i.e. when
' you created a ucShellBrowse on your form, or when it was hidden then shown),
' there would be the space for it at the buttom but the word 'Status' appeared
' at the top in a graphical glitch. This never effected runtime, and it also
' appeared normally in design mode the rest of the time too.
'
'New in 6.7.1 - Released 16 Dec 2019
'
'-MAJOR BUG FIX
'-First off, FilesChecked didn't return anything, and further:
'-As of the previous version, for checked items, there was only FilesChecked(),
' which returned only the names of both files and folders. I hadn't considered
' search results and custom folders, where each item has a different path. There
' is now the following:
' FilesChecked() - Only files, only names
' FilesCheckedFull() - Only files, full paths
' FoldersChecked() - Only folders, only names
' FoldersCheckedFull() - Only folders, full paths
'
'New in 6.7 - Released 16 Dec 2019
'
'-Added AllowRename option to set whether renaming items (Label Edit) is enabled,
' previously it was always enabled with no option. If False, the Rename shell
' context menu verb will not appear either.
'
'-Added DragStart event that gives file list / key state of a drag operation.
'
'-Added HideDropdownIcons option to toggle images in the directory dropdwon.
' NOTE: ComboHideIcons, added in the previous version, hides the edit image only,
'       icons are still displayed in the dropdown.
'
'-HideIcons can now be changed during runtime.
'
'-The View Mode will now update in design view if the view is supported (i.e. set
' to Large Icon, Small Icon, List, or Details; the rest only apply during runtime.)
'
'-Added user option bLimitHideIconViewToLogical to allow Large Icon, Tile, etc,
' when HideIcons is true if you really want that.
'
'-Added ShowHiddenItems and ShowSuperHidden options with 3 options: Use Explorer,
' which uses the system setting for 'Show hidden files and folders', then Always
' Show and Always Hide. Use Explorer is the default.
'
'-Added HeaderOverflowButton option for when there's additional columns; when the
' button is clicked, the next column is brought into full view.
'
'-Added AutoCheckSelect option. If Checkboxes are enabled, selected items are
' automatically checked, and unchecked when unselected.
'
'-FilesChecked() will now return only file names instead of full paths, so that
' it's consistent with Files()
'
'-Added RedrawList method to call LVM_REDRAWITEMS, for when you change coloring
' settings but don't need to reload the contents.
'
'-(Bug fix) The new Search feature did not support searching a library from the
'           root (as opposed to a folder within the library).
'
'-(Bug fix) A new feature in the previous version broke support for hiding column
'           headers in Details view when set in the IDE. And if applied during
'           runtime, it triggered a bug in the ListView COMCTL where the header
'           then wouldn't be fully hidden, and show it with a height of a ~5px.
'
'-(Bug fix) On Windows 8 and above, virtual objects besides drives were included
'           while in Drives Only mode.
'
'-(Bug fix) When rating stars were displayed, mousing over items that didn't have
'           rating support would still draw, and lock in, a hot state of however
'           many stars the initial mouse position was in. Now stars never change
'           in any way for items that don't support them.
'
'-(Bug fix) Various issues with History navigation (forward/back/menu) arose when
'           BrowserStartLastPath was set but the last path no longer existed.
```

*New Demo*
To show how despite some of the very complex screen shots, the original idea of this control was to offer a modern replacement for putting the VB DriveList, DirList, and FileList on your form, there's a new demo where I put the closest replacement settings side by side:

The only one that's not nearly completely identical is the DirList; the dropdown has the indented tree, but below that is just the folders, no files are shown there. You can of course also use the ucShellTree project (which has the option to set a single drive as the root if you wanted) as a substitute here.

*Major Bug Fix for Checked Items Lists*
The project attachment was updated at 10:30PM EST, but still as Version 6.7, because of problems with the functions that list checked items.
-FilesChecked() didn't actually return anything, and was set to only return file names, and also folder names.
-I hadn't considered search results and custom folders, where different items might have different paths.
-So now, FilesChecked() works and returns only file names, not folder names, and the following were added:
--FilesCheckedFull() for full paths of files
--FoldersChecked() for folder names
--FoldersCheckedFull() for folder full paths

Sorry for the oversight.

*Additional Important Bug Fix for BrowserPath*
Well much to my great embarassment, there's another bug it's fairly important to fix right away.
BrowserPath couldn't be changed in the IDE. If you downloaded v6.7 before 9:50PM EST on 12/17, please re-download to fix this issue (and the below issue if you didn't get that update). This is easy to fix manually if you would like so you don't need to re-DL, the last two lines of Property Let BrowserPath are:


```
End If
End Property
```

Replace those two lines with these:


```
Else
    m_sCurPath = sNewPath
End If
PropertyChanged "BrowserPath"
End Property
```

----------


## fafalone

*Version 7.0 Released!*

_Progress marquee while loading folders_


_Custom columns with images_


_Custom root_


_Hyperlinks_

This version adds a number of signficant features and addresses some bugs. There's a new control mode: Dropdown-Only With Controls, previously the dropdown only meant no nav buttons, search box, etc. Custom columns can now be added, and they support images (note: If you set a column as having images, you can not specify an image, and/or text, for an item and none will appear, e.g. to not have anything for folders). The combo edit box turns into a progress bar to provide visual feedback while folders are loading. You can specify a custom root for the dropdown, and optionally lock the file view to locations under it. Hyperlinks like in Programs and Features are now supported. Several other minor features have also been added.
Bug fixes include RefreshTree which wasn't working, Simple Mode for the dropdown had a few issues, the zebra-then-crash with Sub Main bug has been fixed, and previews mostly didn't work at all for devices like cameras and phones. Additional minor fixes as well.

*Project Updated to Version 7.1 on 21 February 2020*
Major bug fix: If you started loading another directory while the previous one was still loading, the contents of both (or more) folders were loaded. Wanted to push this update right away especially before too many people updated to 7.0 (but the bug first appeared in v6.4, when DoEvents was added so the whole control wasn't unresponsive while loading). 
The dropdown and control box are disabled while loading now, since any number of actions would open a new folder (back/forward, bookmarks, special folders, thumbnail view would screw things up too, search, up... so it's all disabled, as are any keyboard commands and path changes done via code).

Added a couple small features and updated the demo projects to ditch Sub Main over issues with that, and added a folder check and used it to show using the custom columns to only display entries for files-- see updated picture above.

Here's the full changelog:


```
'New in v7.1 (Release 21 Feb 2020)
'
'-Added ItemIsFolder function to quickly determine if a given item is a folder.
' You can specify either its position (unsorted, but as given by other functions),
' by its name, or by its full path. Looked up in that order.
'
'-Added MaxHistoryDisplayed property to limit how menu items appear on the History
' popup menu. If the limit is exceeded, it displays the n/2 items before and n/2
' items after the current index. If that results in less than the limit shown, the
' end not at its limits (0 or the upper bound) is expanded. See ShowHistoryMenu for
' the calculation.
'
'-(Bug fix) If you selected a new folder from the dropdown while one was still being
'           loaded, both folders would have their files listed. Since a number of
'           features open folders, the combobox, control box, and menus are now
'           disabled during loading.
'
'-(Known Issue) If a constant is defined in an enum in the TLB, used in this control,
'               and then defined in a .bas module containing Sub Main, it triggers
'               the stripes-then-crash bug when normal VB controls are modified.
'               I've changed the ones in the Demo projects, but finding them all is
'               impractical.
'
'New in 7.0 (Released 18 Feb 2020)
'
'-New Control Mode: SBCTL_DirOnlyWithCtls (Directory Drop-down Only, With Controls)
' This mode is the same as DirOnly except the control buttons are also available:
' Back, Forward, Up, Bookmarks, View, and Search are all available, and although
' it will almost always make sense to hide the View button, that's left up to the
' user. The status bar is not available in this mode.
'
'-You can now specify a custom root for the directory dropdown with the CustomRoot
' property. There's also the option CustomRootLocked, which if True means the user
' will not be able to open any path that's not a child of the root. If the startup
' path is not a child of the root, the root is then used as the startup path.
'--The custom root is parsed the same way as BrowserPath, so special locations with
'  ::{ are accepted, and environmental variables are expanded. If the mode is Drives
'  Only, the drive of the root is used if not locked out. FTP sites are supported.
'--If ComputerAsRoot is set, it will supercede the CustomRoot path.
'--CustomRootLocked does not restrict the appearance of invididual items in Custom
'  Folders or Search Results, but if one of the items is a folder, and not a child
'  of the root, you will not be able to navigate into it.
'
'-ComputerAsRoot can now be changed during runtime, as can the new CustomRoot prop.
'
'-When loading a folder, the edit box of the dropdown is now turned into a progress
' bar in marquee mode (no way to get the item count in advance). This is set via
' the LoadingMarquee property, which defaults to true.
' The methods, StartLoadingMarquee and StopLoadingMarquee, are public in case you
' ever wanted to use them manually, e.g. if you're using DirOnly mode and doing
' your own loading.
' Performance: I tested to make sure this wasn't creating performance issues for
'              large folders, and found it only adds 100ms per 3,000 items.
'
'-You can now add an entirely custom column. First, use the AddCustomColumn
' function-- make sure to save the return as the column id (you can add as many
' as you want). Then, respond to the CustomColumnQueryData event to supply the
' column text for each item. Column can be removed via code with the
' RemoveCustomColumn sub (and also via the UI like any other column).
' Custom columns support images; specify when creating. The out_nImage value is
' ignored when not being used.
'
'-Some properties, right now AFAIK only in the Programs and Features folder, are
' displayed as hyperlinks in Explorer. Now one of those can be displayed in the
' control as hyperlinks as well. Only one such column at a time is supported due
' to a graphical glitch that makes more impossible I haven't been able to resolve.
' You can disable any column having links with the bDisableHyperlinkItems user opt.
'
'-Added ability to remove other columns through code as well; RemoveColumnByPropName
' and RemoveColumnByPKEY have been added (the latter, you pass VarPtr(pkey)).
'
'-Portable Devices like phones and cameras are now added to the dropdown when added,
' regardless of the current directory (an entirely separate limited changenotify
' on the Computer/This PC folder).
'
'-Set the letter 'B' as a caption for the Bookmarks button if ComCtl6 is not
' available. Since there's no support for image buttons without it, the button
' wsa previously blank.
'
'-It's now possible to set custom image lists for the ListView and ComboBox.
' SetCustomListViewImageLists takes a small, large, and jumbo imagelist. If all
' goes well, return is S_OK. Otherwise the return code indicates which imagelist(s)
' failed; &H2, &H4, and &H8 are Or'd together respectively for a failure in that list.
' SetCustomComboImageList takes a single ImageList of 16x16 (or current DPI equiv),
' and returns the result of the API that sets it.
' You can pass -1 to not set a given image list, or pass 0 to clear.
' There's also an optional argument to set a custom state imagelist; this is the
' checkbox imagelist, and replaces the existing images of checkboxes when enabled,
' and can have any number of images to cycle through.
'
'-(Bug fix) RefreshTree did not work.
'
'-(Bug fix) A number of properties in the design time property box had their
'           descriptions stop showing up. This didn't effect usage.
'
'-(Bug fix) History can be used through code, and previously, history wasn't being
'           set when the mode was DirOnly/DrivesOnly because it was set in the Load
'           Folder routine, which exited before the history block if no LV present.
'
'-(Bug fix) If a root item didn't support IShellIcon, the whole EnumRoot function
'           would fail and leave the dropdown empty.
'
'-(Bug fix) Names ending in a . or space are not valid names and Explorer silently
'           deleted them rather than throwing an error. In mimicking this behavior,
'           while the . or space was deleted from the file record and not sent to
'           Explorer, it was not deleted from the displayed name.
'
'-(Bug fix) After loading Computer/This PC, the size/type order in Tile View became
'           inverted in other folders.
'
'-(Bug fix) If the dropdown was in Simple mode, ComboCanEdit, double-clicking for
'           full path, and other edit box features did not work, because the normal
'           CBEM_GETEDITCONTROL message does not work with this style; had to switch
'           to using FindWindowEx to get the edit hWnd.
'
'-(Bug fix) When the dropdown was in Simple mode, the bottom border was truncated.
'
'-(Bug fix) The Search Box still had a left margin for the icon even if the icon was
'           not present (it's in the resource file).
'
'-(Bug fix) If a Private Enum defined in a UserControl had the same name as one that
'           is defined in a module containing Sub Main, placing more than one of the
'           UserControl in a project caused the control to be grayed out and then an
'           app crash when any other control was initially added to the form.
'           To fix this, all API enums in this control have been prefixed with ucsb_
'           If you're modifying the code of this control, just keep that in mind.
'           No change is needed for using this control or any other code as they're
'           all Private.
'
'-(Bug fix) File previewing on devices like cameras and smartphones had two bugs:
'           First, file parsing names were represented by GUIDs, so no extension
'           was being returned, breaking image previewing for most types.
'           Second, the GUID names also does not work with CreateFile, thereby
'           breaking any previewer that used IStream, like text files.
'           The extension is now read from the display data and an alternate way
'           of obtaining an IStream was implemented. All previews should work now.
```

----------


## yokesee

good job.
everything works well

Greetings

----------


## fafalone

Just to update ucShellBrowse users, I found a performance issue that's exclusively responsible for the slowness in large folders, the control can literally be up to 100x faster loading 3000 items in <2s instead of 100+s:

(Issue cleared, see below)

----------


## fafalone

*Project Updated - 07 March 2020*
*7.2 R2*: A second revision of v7.2 was released on March 7th, since the original 7.2 release zip was missing the main demo. The only change is a minor update to sorting which only effects special folders with default columns in non-default positions, and an option to always use IShellFolder-based sorting for non-default columns, which keeps folders separated but in most (but not all) cases carries a significant performance cost; default is off.

_Original update on March 5th:_
Due to the extreme magnitude of the performance gain from the following issue, I went ahead and updated the project:

(Fixed in 7.2: Major performance issue) It turns out basically the entire reason ucShellBrowse is slow for large folders is querying for the overlay icons. It was being done with IShellIconOverlay as that's the only way to get custom overlays for Github, TortoiseSVN, Dropbox, etc. but that single call causes a performance hit by a factor of between *10x and 100x*. Loading a 3,000 item folder literally goes from 100s to 1s just by removing that call. It's now a default-off option. The new way will still display overlays for Shortcuts and Shared folders without enabling the ExtendedOverlays option or suffering any performance degradation, as the index for these is a system constant and presence is determined simply by normal attributes.

Also fixed the remaining combined-folders bug.



```
'New in v7.2 R2 (Released 07 March 2020)
'
'-Rereleased because I forgot to include the main demo.
'
'-Sorting system has an optional upgrade: AlwaysSortWithISF uses the IShellFolder
' CompareIDs sorting method for all columns that are supported. This keeps folders
' separated and sorts non-standard data types better, but *sometimes* carries a
' significant performance hit, so it's off by default.
'
'-(Bug fix) For the CompareIDs sort for the standard types (always enabled), some
'           special folders contained the standard types, but in a non-standard
'           order. Since the order was hard-coded, this led to incorret sorting.
'           Now columns are mapped with each folder load to the correct column id.
'
'New in v7.2 (Released 05 March 2020)
'
'-Extended Icon Overlays (e.g. for Tortoise SVN, Dropbox, Github, etc) are now
' an option, ExtendedOverlays, that default to false after finding that querying
' for them causes a *massive* performance hit. I thought things were just slow
' because of complexity and this being VB, but just eliminating the query speeds
' up loading folders ***by a factor of 10-100**. 3000 items used to take over 100s
' on a 7200rpm spinning drive, it now only takes 1.4s.
' The Shortcut overlay, and Share overlay, can be determined by attributes, so these
' are the basic overlays that will still appear when the extended ones are turned off.
'
'-Numerous other internal performance improvements have been made.
'
'-(Bug fix) The folders combining if one was selected while the previous was still
'           loading hadn't been fixed for manual calls to CreateCustomFolder or one
'           of the file search calls.
```

Also note that ucShellTree has been updated with this same fix, if you also use that in your project.

----------


## yereverluvinuncleber

This is an impressive piece of work. I could really do with the same filelistbox control in VB.NET.

----------


## fafalone

Thanks  :Alien Frog: 

Always found shell programming interesting, so creating a full-blown Explorer-type control was always inevitable  :Big Grin:

----------


## fafalone

*Current Version Updated - 16 March 2020*

*v7.2 R5*: My absent-mindedness curse continues. The R4 fix for Search only fixed searches made through the UI, but searches can also be made through code, so that needed an urgent fix too:
*(Bug fix)* The 7.2 R5 release fixed this issue for searches made via code by calling the Public methods ExecFileSearch and ExecFileSearchEx.
To apply this fix manually, in the ExecFileSearchEx function (which is called by ExecFileSearch so only this function needs to be modified), replace the following block:


```
Dim pLibTmp As IShellLibrary
Set pLibTmp = New ShellLibrary
pLibTmp.LoadLibraryFromItem pLocation, STGM_READ
pLibTmp.GetFolders LFF_ALLITEMS, IID_IShellItemArray, ppia
If (ppia Is Nothing) Then
    If CreateSearchLibrary(pObjects) = S_OK Then
        pObjects.AddObject ByVal ObjPtr(pLocation)
        Set ppia = pObjects
    End If
End If
```

with this one:

```
Dim lp As Long, sPath As String

siCurPath.GetDisplayName SIGDN_DESKTOPABSOLUTEPARSING, lp
sPath = LPWSTRtoStr(lp)

If Left$(sPath, Len(sLibRoot)) = sLibRoot Then
    Dim pLibTmp As IShellLibrary
    Set pLibTmp = New ShellLibrary
    pLibTmp.LoadLibraryFromItem siCurPath, STGM_READ 'Check if it's a a real library-- if it is, we need to get the folder array directly or search fails
    pLibTmp.GetFolders LFF_ALLITEMS, IID_IShellItemArray, ppia
    If (ppia Is Nothing) = False Then 'Valid Library, proceed here.
        GoTo defcsl
    End If
End If
defcsl:
If (ppia Is Nothing) Then
    If CreateSearchLibrary(pObjects) = S_OK Then
        pObjects.AddObject ByVal ObjPtr(pLocation)
        Set ppia = pObjects
    End If
End If
```

Also fixed in R5, two timers were enabled from design time/startup, sometimes causing issues where the IDE flashed [running] a few times a second when a Form was loaded in design view, causing problems with pop-up code completion in the IDE. To fix this manually, open ucShellBrowse in Design View and for tmrChangeQueue and tmrResize, set the Enabled property to False. Then also delete tmrFilter; it's also enabled but not actually used for anything anymore.

*v7.2 R4*: I swear I'm cursed. Search has been completely broken besides in a Library since v6.7.
*(Bug fix)* In v6.7 a patch was applied because Search wasn't working in a Library, in a way that should have produced a failure and fallback if we weren't in one. It turns out it has been returning a valid but corrupted object the whole time since then, so Search has been broken everywhere except in a Library since then. 
Projected updated to v7.2-R4 with a fix. If you want to apply a quick manual fix, replace the function CreateSearchScope with this version:


```
Private Function CreateSearchScope(ppia As IShellItemArray) As Long
Set ppia = Nothing
Dim pObjects As IObjectCollection
Dim hr As Long

Dim lp As Long, sPath As String
siCurPath.GetDisplayName SIGDN_DESKTOPABSOLUTEPARSING, lp
sPath = LPWSTRtoStr(lp)

If Left$(sPath, Len(sLibRoot)) = sLibRoot Then

    Dim pLibTmp As IShellLibrary
    Set pLibTmp = New ShellLibrary
    pLibTmp.LoadLibraryFromItem siCurPath, STGM_READ 'Check if it's a a real library-- if it is, we need to get the folder array directly or search fails
    pLibTmp.GetFolders LFF_ALLITEMS, IID_IShellItemArray, ppia
    If (ppia Is Nothing) = False Then 'Valid Library, proceed here.
        Exit Function
    End If
End If

If CreateSearchLibrary(pObjects) = S_OK Then
    pObjects.AddObject ByVal ObjPtr(siCurPath)
    
    Set ppia = pObjects
    Set pObjects = Nothing
    
    CreateSearchScope = hr
End If

End Function
```


*v7.2 R3*: Very minor update for the following:

*(Bug fix)* When setting up the always-on overlays for Shortcuts, my system had a bug at the time which led to me putting down the wrong overlay index. It was set to 4, it should be 2. The project was updated to v7.2 R3 with a fix for this. If you just want to apply a quick manual fix, in LVLoadFolder and in LVAddEntry, there's the following block:


```
            If (lAtr And SFGAO_LINK) = SFGAO_LINK Then
                lpIconOvr = 4
            End If
```

Change the 4 to a 2. 


Also note that if your last DL of this project was missing the main demo in \Demo, there was a silent update on March 7th when R2 was put out including the demo and a sorting fix for some rare scenarios where it sorts wrong; see Post #81 just above.

----------


## fafalone

*ucShellBrowse v7.4 Released! (30 March 2020)*

Sorry for the frequent updates, but I found 2 serious bugs present in the 7.x series. Compiled exes could not load portable devices, and some situations with overlays enabled led to crashes.
BUT: There's some great new features. The Large Icons are now the size of Explorer's, and there's support for Medium Icons (the old large) and Extra Large Icons. All view modes can now be the startup mode from Properties in Design Mode. There's also a couple smaller features and fixes.




```
'New in v7.4 (Released 30 March 2020)
'
'-Large icons are now actually large.
'
'-Also added support for 'Medium' icons, which are the old large, and Extra
' Large icons, which are 256x256 (*scale). These aren't 'true' modes; to make
' the 'Large' icons like Windows 7 and 10 sized, the same general approach for
' thumbnails had to be used; we load a copy of the 'Jumbo' 256x256 image list,
' then scale down from that by copying the needed icons to a local ImageList.
' So once that's done, we can add any other size by simply changing the scale
' factor. You could easily look at SwitchView to see how it's done for XL and
' Medium, and add more.
' Note: By default, icons in Medium/Large/XL aren't loaded until the item first
'       comes into view; like with thumbnails, there's a new IconPreload option
'       if you want to load them all during the initial folder load.
' Sizes: Medium is 48x48, Large is 96x96, and XLarge is 128x128, and you can
'        change these in the User Options section below this changelog if so
'        desired. It's not recommended to exceed 512x512.
' Links: There's this weird glitch where the presence of some shortcuts to a
'        folder, in certain other folders, causes not only itself, but some
'        other links, to return the default document icon instead of the real
'        icon. This bizarrely goes away if you Refresh, but reappears if you
'        navigate away and come back (even though Refresh is just calling
'        LVLoadFolder again the exact same way).
'        I can't isolate the exact circumstance, and refreshing every time is
'        a huge performance hit, so a workaround was developed where links
'        have their icons loaded manually.
'        There's a User Option, nManualLinkIconLoadingMode, with 3 options
'        for this; 0=disable it and always just use the same automatic method
'        (IShellItemImageFactory), 1=Use it only for links to folders (which
'        trigger the bug, so this avoids it), and 2=Use it for all links.
' Watch: This whole system seems to trigger a number of bugs where blank or
'        default or incorrect icons are loaded. I've added a bunch of work
'        arounds, but if you encounter any situation where the wrong icons,
'        or no icons, are being loaded, please let me know!
'
'-All View Modes are supported on startup via the ViewMode setting in the
' Properties list, there's a minor tradeoff in that no change is reflected
' in Design View.
'
'-Now the Bookmarks submenu is only added to the folder background right-click
' menu if it's not already present in the control box.
'
'-Support for items marked as SFGAO_GHOSTED but not SFGAO_HIDDEN added.
'
'-(Bug fix) When Extended Overlays are enabled, the wrong method was called,
'           sometimes leading to incorrect overlays or crashing.
'
'-(Bug fix) Switching into Tile View lost the sorting order, so folders no
'           longer appeared first. Switching to Tile View now sorts by name.
'
'-(Bug fix) Some bizarre memory issue related to the order of things in the
'           LVLoadFolder routine broke loading more than 1 dir into Portable
'           Devices in compiled exes only.
```

----------


## yokesee

you could create a file explorer.
for example I really like "q-dir".
with tabs, preview.
with your wit, surely you could create a good one.
Alternate to Windows Explorer and vb6.

greetings great job

----------


## fafalone

That's basically what this control is... have you seen the ShellTree control this is often combined with? It lets you have a navigation tree for a complete file explorer experience, and of course there's a lot of points to control the UCs from code to build programs around them. There's even a bunch of extra functionality available through code that's not part of the UI. There's very, very little that an Explorer window can do that a form with ShellBrowse+ShellTree can't*, and quite a number of things these can do that Explorer can't.



Thanks for all the compliments btw (yereverluvinuncleber as well)... always good to know other people think this stuff is cool too  :Thumb: 

* - The only real thing I can think of that still needs to be replicated... in the 'Details' bar at the bottom, Explorer can handle combining multiple files like showing two different years for two different MP3s, or noting if a property is the same for all selected files or 'Multiple values'... mine can only show details of a single file. It's gonna be a nightmare replicating that but it's on the list. Can't really think of anything else

----------


## yokesee

if I have been following many of your projects.
When I have time I will try it more thoroughly.

I have found a bug.
when you activate preview panel and select an image everything closes, in ide too.
oleexp 4.62

how many controls could be put without overloading the project.

keep it up very good great job

----------


## yereverluvinuncleber

It really might be worth making into a standalone program that emulates the old explorer in XP. I still miss that tool daily. None of the alternatives have it quite right.
I did make my own drive/folder/file list in .javascript and so I know how hard it is to get right. 

I will use your creation in one of my future projects if that's OK?

----------


## fafalone

God damn Windows 10  :Frown: 

It works perfect on Win7.

I just can't win lately. Every time I try to update, something somewhere else breaks in some unanticipated way.


Edit: Posted a fix, see below.

---

@yereverluvinuncleber- Of course you're welcome to use it in your projects, that's what it's here for  :Big Grin: 
It wouldn't be too hard to make what looks like an old-style Explorer window; there's a few things that would need to be publicly accessible on the control that aren't right now; like Select All/Invert Sel, sorting and grouping commands-- which would require access to the current columns, which might be a little tricky. I'll work on making more commands available through code for the next big update.

Edit;
Just playing around a bit, to replicate the sort menu for a container window menu, you'd need a column list... you could get the column PROPERTYKEYs and display names like this:


```
Public Function GetCurrentColumnCount() As Long
GetCurrentColumnCount = Header_GetItemCount(hLVSHdr)
End Function

Public Function GetCurrentColumns(ptr_pk_ar As Long, sDispNames() As String) As Long
Dim pk() As oleexp.PROPERTYKEY
Dim lColCnt As Long
lColCnt = Header_GetItemCount(hLVSHdr)
ReDim pk(lColCnt - 1)
Dim i As Long
Dim lp As Long
For i = 0 To (lColCnt - 1)
    lp = GetHDItemlParam(hLVSHdr, i)
    pk(i) = uColData(lp).pKey
    sDispNames(i) = uColData(lp).szDisplayName
Next i
CopyMemory ByVal ptr_pk_ar, pk(0), LenB(pk(0)) * lColCnt
End Function
```

Called like


```
Dim pk() As oleexp.PROPERTYKEY
Dim sNm() As String

lCt = ucShellBrowse1.GetCurrentColumnCount
ReDim pk(lCt - 1)
ReDim sNm(lCt - 1)
ucShellBrowse1.GetCurrentColumns VarPtr(pk(0)), sNm
```

Yeah I can definitely make everything you'd need accessible.

Edit2: As for the rest that's not available... I haven't tested any of this for functionality, just syntax, but it's my bedtime... so if you want to pick it up, here's roughly how the rest would work for the sorting/grouping stuff not already accessible through code. (Note: the history list is already available through code, as well as back/fwd/up; and the selected shell item(s) so you can get context menu interfaces for File)


```
Public Function GetGroupColumn() As Long
GetGroupColumn = lGrpCol
End Function
Public Sub InvokeGroupByColumn(lCol As Long)
'Pass -1 for 'None'
If lCol = -1 Then
    SetGroupMode SBGB_None
    lGrpCol = -1
    bCatGrpActive = False
    Exit Sub
End If
Dim lp As Long
lp = GetHDItemlParam(hLVSHdr, lCol)
If lp <> lGrpCol Then
    lGrpCol = lp
    Select Case lp
        Case lDefColIdx(0): SetGroupMode SBGB_Name
        Case lDefColIdx(1): SetGroupMode SBGB_Size
        Case lDefColIdx(2): SetGroupMode SBGB_Type
        Case lDefColIdx(3): SetGroupMode SBGB_DateModified
        Case lDefColIdx(4): SetGroupMode SBGB_DateCreated
        Case lDefColIdx(5): SetGroupMode SBGB_DateAccessed
        
        Case Else: SetGroupMode SBGB_Extended
    End Select
    bCatGrpActive = False
End If
End Sub
Public Sub InvokeGroupByPKEY(ptr_pkey As Long)
Dim pk As oleexp.PROPERTYKEY

If ptr_pkey Then
    CopyMemory ByVal VarPtr(pk), ByVal ptr_pkey, Len(pk)
Else
    DebugAppend "InvokeSortByPKEY::No pointer to PKEY"
    Exit Sub
End If

Dim lColCnt As Long
lColCnt = Header_GetItemCount(hLVSHdr)

Dim i As Long
Dim lp As Long
For i = 0 To (lColCnt - 1)
    lp = GetHDItemlParam(hLVSHdr, i)
    If IsEqualPKEY(pk, uColData(lp).pKey) Then
        lGrpCol = lp
        Select Case lp
            Case lDefColIdx(0): SetGroupMode SBGB_Name
            Case lDefColIdx(1): SetGroupMode SBGB_Size
            Case lDefColIdx(2): SetGroupMode SBGB_Type
            Case lDefColIdx(3): SetGroupMode SBGB_DateModified
            Case lDefColIdx(4): SetGroupMode SBGB_DateCreated
            Case lDefColIdx(5): SetGroupMode SBGB_DateAccessed
            
            Case Else: SetGroupMode SBGB_Extended
        End Select
        bCatGrpActive = False
        Exit Sub
     End If
Next i
End Sub

Public Sub InvokeSortByColumn(iCol As Long)
LVColumnClick iCol
End Sub


Public Sub InvokeSortAscending()
If lSortD = 0 Then
    LVColumnClick lSortK
    lSortD = 1
End If
End Sub
Public Sub InvokeSortDescending()
If lSortD = 1 Then
    LVColumnClick lSortK
    lSortD = 0
End If
End Sub

Public Function GetSortDirection() As Integer
'0=Descending, 1=Ascending
If lSortD <> 0 Then
    GetSortDirection = 1
End If
End Function
Public Function GetSortColumn() As Long
GetSortColumn = lSortK
End Function

Public Sub InvokeSortByPKEY(ptr_pkey As Long)
Dim pk As oleexp.PROPERTYKEY

If ptr_pkey Then
    CopyMemory ByVal VarPtr(pk), ByVal ptr_pkey, Len(pk)
Else
    DebugAppend "InvokeSortByPKEY::No pointer to PKEY"
    Exit Sub
End If

Dim lColCnt As Long
lColCnt = Header_GetItemCount(hLVSHdr)
Dim i As Long
Dim lp As Long
For i = 0 To (lColCnt - 1)
    lp = GetHDItemlParam(hLVSHdr, i)
    If IsEqualPKEY(pk, uColData(lp).pKey) Then
        LVColumnClick i
        Exit Sub
    End If
Next i
End Sub
Public Sub InvokeColumnSelector()
LoadColumnSelect
End Sub
```

----------


## fafalone

*CRITICAL UPDATE :: Version 7.4 R3, 02 April 2020*

*(R2)* In Version 7.4, previewing images with Windows 10 causes an appcrash as noted in the posts above. This version fixes the new method.

What happened, the new method I started using reads files with gdipLoadImageFromStream. I got the IStream from taking the IShellItem and using BindToHandler/BHID_Stream/IStream. This works on Windows 7, but for some reason on Windows 10, this causes an appcrash when gdipLoadImageFromStream is called. As a workaround, the file is opened with CreateFileW, read into a byte array, then an IStream created using CreateStreamOnHGlobal. The IStream resulting from that can be passed to gdipLoadImageFromStream without an issue.

*(R3)* - If you don't have have this current version, 7.4 R3, icon scaling for Medium/Large/X-Large will be either too large or too small in most circumstances. Total chaos broke lose with the scaling for M/L/XL icons being either too large or too small, after it was previously perfect. Then I thought I pushed a fix with just 1 DL of the old one, but that's not what wound up on the board here. Then 4 people had DL'd it, so I triple-checked everything in a whole new version folder so nothing could get mixed up this time. I'm so sorry for all these dumb errors  :Blush: 
This may have applied to the original 7.4 release as well; the zip I have they're too small on a zoomed monitors IDE, but correct in the exe. I'm not going to check on my other computer right now, but given the critical R2 fix, it's important to update anyway, so bottom line: _If the ucShellBrowse icons are bigger or smaller than Explorer in either in the IDE or EXE, v7.4 R3 will fix it._ 

Also fixed a bug where selecting 'Desktop' from the dropdown wasn't doing anything. 
---------------
Original notice: geez... I'm losing it or something. I spent hours getting things just right with the new icon sizes so they're correctly sized whether dpiAware is true or not, and in IDE or not since it's all different. Somehow they just became wrong. I got everything readjusted for Win7/Win10/Zoomed/Not/Ide/Exe while there was just 1 DL (if that was you and you notice icons are too big, sorry, re-dl). I added an 'actual zoom' because if dpiAware was false, it didn't apply to the APIs that read the images and sized them, but now for some reason it started just not being right and the original scaling system was now right when it was wrong... ugh.

Update: Ok I'm definitely losing my mind. I swear I updated that icon thing, but when I checked, nope. If your icon size is messed up download R3.


*(R4, Minor, Non-critical update)*
The current version is R4. If you already have at least R3, you don't need to rush to get R4, it's just only 3 people had it so far, I discovered a minor bug, and wanted to nip it in the bud so it's not around for a while until the next major upgrade.
The Column Select box got bigger and bigger each time it was opened when dpiAware was on and DPI scaling was above 100%. Also made the column width text box update when keyboard scrolling. Again, very minor, not critical to update again.

----------


## yokesee

thanks for solving the problem.
I found two bugs but could not reproduce it again.

one was with the up button everything was closed.
and another was browsing the files and folders and zip files.
but I could not reproduce them again.

windows 10 home 1803.

Greetings

----------


## fafalone

Ok, if they pop up again let me know. Haven't ever had trouble with the Up button, but haven't thorough checked zip files recently.

----------


## yereverluvinuncleber

I have plenty of ideas for a replacement explorer and would love to build one. Perhaps when I have finished my current VB6 project.  I have two in mind, one is a straight XP explorer type replacement as above but the other is more exotic and I doubt it can be achieved in VB6. The other was a steampunk/medieval version that I coded successfully for .javascript a long time ago.

----------


## fafalone

What kind of file browser couldn't be achieved in VB6?

----------


## yereverluvinuncleber

That graphical one above... I'm sure it could but my experience in trying to skin VB6 apps has been off-putting.

----------


## yereverluvinuncleber

PS can you restructure post #82?
it is screwing up the formatting of this whole page, causing it be so wide as to be painful to navigate.

----------


## fafalone

Of course you could make that in VB, it's just all graphics. You'd just set up the graphics any number of ways, including accelerated with D3D or DD, and then grab file lists and icons to draw where needed. Even in this project, all the icons are extracted and drawn with graphics functions for some parts (thumbnails and icon view). 

Fixed that wide post.

----------


## Schmidt

> I have plenty of ideas for a replacement explorer and would love to build one. 
> Perhaps when I have finished my current VB6 project.  
> I have two in mind, one is a straight XP explorer type replacement as above but the other is more exotic and I doubt it can be achieved in VB6.


There'd be no problem with VB6 and graphics-heavy GUIs, when you'd use appropriate helper-libs,
to build these without any API-calls in your UserCode (and thus without having to care about handles, or proper handle-freeing).

Here's, what I've thrown together in an hour, using RC5 and two Widgets from vbWidgets.dll:



The Widget to the left is cwDirList - and the one to the right is a cwVList in "TileMode" - filtering for only "image-files" in the left-selected Folder.
(on both of them I've disabled the BackGround, and made them a bit more transparent).

Always wondered, why you ventured into .NET-land (to re-implement your VB6-RocketDock-Editor) - 
and never once tried to re-implement it using the RC5-Widgets (using much less code than the other two variants you currently have).

Manipulating all that graphical-stuff you so like, would be a breeze with that tool (Controls which respect Alpha, even when nested in each other) -
and of course you'd feel like "a total newbie" the first week - but you should be able to "get the hang of it" after that.

Olaf

----------


## yereverluvinuncleber

> Always wondered, why you ventured into .NET-land (to re-implement your VB6-RocketDock-Editor) -


Well, it is all about teaching myself the technologies, old and new, those that are generally "out there". So, this VB6 re-learning is really just a refresher for me, GDI+ fits into that and then I'm dipping my toes into the VB.NET world to see how it feels, I've started but I must complete it. 

When I feel half-competent (and I don't feel anywhere near that yet but I'm getting there) then I will dip my toes into the RC5 stuff that you suggest but first I have a VB6 project to complete, then a VB.NET migration to complete, then I will complete my re-skinning project for the same codebase and then finally onto my old Mil.Sim. code with a new approach, possibly a VB.NET front end and a C++ back end, I'm not sure... Then there are little delectations like the above explorer that I'd 'like' to do but probably won't get round to for a while.

I like the explorer that you just knocked up. I'd be happy to send you my image sources, both PSD and PNG if you wanted to do so before me?

Just as the bear with little brain, for me it is just small steps at a time - but with not a lot of time to do it in - so progress is slow and what technologies I can experiment with are limited. It has to be real-word usage or the what I am doing won't help me if I have to apply these technologies in a real-life work situation. That is my aim Olaf so I frankly can only do so much...

----------


## Schmidt

> I like the explorer that you just knocked up. I'd be happy to send you my image sources, both PSD and PNG if you wanted to do so before me?


Well, I've always liked your graphics-stuff - and would start with such a "porting" on my own (whenever I find time) - 
posting the results into the CodeBank, when the whole thing accumulated to something "presentable".

As for your image-offerings...
 Somewhere in the CodeBank there's a PSD-file-parser I've adapted (which is able to extract the different layers to PNGs) - 
but if you have the layers as separated PNGs already available, then I'd prefer that (to save some time).

Also your current VB6-sources would be of help (time-saving-wise), to better see, what functionality you were aiming for...

Perhaps zipped and uploaded to some WebHost, posting the URL via private forum-PM?

Olaf

----------


## fafalone

*Project Updated - Version 8.0 Released on 23 April 2020*

-There's a number of new features here, as the major version change might indicate. The biggest is portability: The images are now built into the control. You no longer need to worry about keeping those images with the control, and the only thing you need the .res file for is the manifest. The Demo contains 3 images in the resource file that are just for the Demo, you do not need to move those to another .res, they're not part of the control.
-Next up, a large number of subs/functions were added to allow all functionality to be controlled through code, to make it easier to embed the control as part of a larger file browser or similar. See the changelog for a full list.
-All the panel toggles are now on their own submenu ('Layout'), which contains a new option to switch between the two most common modes, Files Only and Directories+Files. This option won't appear in other modes and you can disable its appearance all together if desired. There's also an option to add a 'Navigation Tree' item-- this is for projects that use ucShellTree, it can signal a toggle so you know when the user wants the tree shown.
-If you've got editing turned on in the directory box, you can now enable Autocomplete on it.
-Then we've got a number of smaller feature updates and a fix for the handful of minor bugs.

Full changelog:


```
'Version 8.0 R1 (24 April 2020): Fixed out of place parenthesis triggering compile error.
'New in v8.0 (Released 23 April 2020)
'
'NOTE: As of this version, the images for the buttons and menus are no longer loaded
'      from the resource file. Thanks to an idea by LaVolpe and code by The_trick, now
'      they have been encoded into bitmaps are stored as Picturebox pictures, and are
'      decoded by the control.
'      The control is pbIconData, and if you need to look up the images for whatever
'      reason, the control index is mapped to their old names; e.g. ICO_MNREFRESH is
'      now pbidx_ICO_MNREFRESH, and its value, 6, means its data is in pbIconData(6).
'      From now on, the resource file is only for the manifest, or application data.
'      The demo in \Demo shows a feature for the footer where the control will load
'      icons from the resource file, and these are still included in the demo res
'      file, but they are *not* required to be included in your project, they're
'      exclusively for the demo project's custom footer.
'
'-There's now an Autocomplete option for when the ComboType is Simple or Dropdown,
' and ComboCanEdit is True, that by default will complete paths. The default flags
' are ACO_AUTOAPPEND and ACLO_FILESYSDIRS. To change these flags, use the new Public
' Sub AutoCompleteFlagAdjust. This is *not* enabled by default.
'
'-The DropFiles event now supplies a lot more information. Previous, it only included
' a list of full paths and the drop effect. The following have been added:
'  :An IShellItemArray of the dropped files,
'  :The raw IDataObject received from IDropTarget_Drop,
'  :The full path of the folder it was dropped on (which would not be the current path
'    because of dynamic drag drop, it could be a folder or item within,
'  :An IShellItem of the item it was dropped on,
'  :The grfKeyState value (MK_LBUTTON, MK_RBUTTON, MK_SHIFT, etc),
'  :The x,y coordinate of the drop.
' NOTE: This will require updating the event in any form that is using it, as this is
'       an update to the DropFiles event, and not a new event.
'       Private Sub ucShellBrowse1_DropFiles(sFiles() As String, siaFiles As oleexp.IShellItemArray, doDropped As oleexp.IDataObject, sDropParent As String, siDropParent As oleexp.IShellItem, iEffect As oleexp.DROPEFFECTS, dwKeyState As Long, ptPoint As oleexp.POINT)
'
'-Also now include the IShellItemArray and IDataObject for dragged files in the
' DragStart event. This also requires updating the event args in any form using it.
'
'-The OneClickActivate style now does what it should have been doing; acts like the
' similar option in Explorer and opens the clicked folder or executes the default
' action on a file.
'
'-Moved the Status Bar/Details Pane/Preview Pane/Search Box toggles on the View Menu
' to their own 'Layout' submenu; used the default Windows icons where available.
'
'-For the two most common modes, Files Only and DirAndFiles, there's now a menu option
' to switch between them in the new Layout submenu. You can set whether this menu item
' appears with the EnableUserModeSwitching property; it's enabled by default.
'
'-You can now drop files in attached USB locations. This had been deliberately excluded
' because the code blocked drops on ::{ paths, which are usually non-droppable.
'
'-After noticing the above was sometimes slow and in at least some circumstances doesn't
' display an external progress box, I added a wait cursor and status message indicating
' that files are being dropped (applies to all drops everywhere).
'
'-Added EnableStatusBar property to set whether the toggle for the Status Bar appears
' on the View Menu. Note that with this and the new Layout submenu, the submenu will
' not appear at all if none of its subitems are present.
'
'-Added ShellTreeInLayout property. This is for projects that also use ucShellTree for
' navigation: it adds 'Navigation tree' to the Layout submenu, and raises the new event
' ShowShellTree with true/false when the user clicks it. To set the initial status, or
' when the status is changed externally, of whether the tree is visible, use the added
' ShellTreeStatus property (note: this does not appear in the Property Browser).
'
'-Added DisableOverlays option to entirely disable overlays. If Extended Overlays is set
' to False, the Link and Share overlays are still shown; this disables those as well.
' Extended overlays will not be shown either if this option is enabled.
'
'-Moved thumbnails closer together.
'
'-The ListKeyDown event now also reports the status of the Shift, Control, and Alt keys.
'
'-Added a ListKeyUp event, which responds to WM_KEYUP coming from the ListView.
'
'-New BackgroundKeyDown and BackgroundKeyUp events, for keypresses while the UserControl
' has focus, but not on any of the controls.
'
'-New ComboEditChange event, which passes the new text when the combo text changes. If
' you change the text received, the combo text will be set to the new value.
'
'-New ComboDropdown and ComboCloseUp events.
'
'-Added additional subs/functions to control the browser through code:
'  GetHistoryData(sEntries(), CurrentIndex, MaxDisplayed) : Retrieves the contents of
'    the history record. The return value is the count of entries.
'  GetPidlStoreEntry(path) : For history entries, and some other path scenarios, the
'    parsing path returned may not work for certain locations (virtual locations like
'    non-filesystem locations and devices like phones/cameras); so the control keeps
'    a record of the fully qualified pidl of these locations. IMPORTANT: This shares
'    a reference to the pidl, so it's critical the caller not free it. Copy it if you
'    need to, but don't free it.
'  GetCurrentColumnCount() : Get a count of the number of details columns loaded, for:
'  GetCurrentColumns(ptr_pk_ar, sDispNames()) : To get a list of the current columns,
'    first call GetCurrentColumnCount to get the count, then create an array of
'    oleexp.PROPERTYKEY and String to receive the data. Pass VarPtr(pkey(0)) and
'    Names() to this function to receive the data. This is used for:
'  GetSortColumn() : The index of the column set that the files are currently sorted by.
'  GetSortDirection() : 0 = Descending, 1 = Ascending
'  GetGroupColumn() : The index of the column set that the files are grouped by. If this
'                     returns -1, Group Mode is disabled.
'  InvokeSortByColumn(Index) : Sort by column index.
'  InvokeSortByPKEY(VarPtr(pkey)) : Sort by PROPERTYKEY. The column must be loaded.
'  InvokeSortAscending() : Sort ascending.
'  InvokeSortDescending() : Sort descending.
'  InvokeGroupByColumn(Index) : Group items by the given index of the column set.
'  InvokeGroupByPKEY(VarPtr(pkey)) : Group items by the given PKEY. Must be loaded.
'  InvokeColumnSelection() : Brings up the full list of available columns.
'  InvokeNewFolder() : Creates a new folder and begins the label edit for rename.
'  InvokeSelectAll() : Select all.
'  InvokeInvertSelection() : Invert selection.
'  DetailsPaneHeightLocked PropGet/Set : Note- not shown in Properties
'  PreviewPaneWidthLocked PropGet/Set : Note- not shown in Properties
'
'-(Bug fix) Toggling the .PreviewPane property during runtime resized the ListView over
'           the pane, but was accidentally showing it when set to False, so it became
'           visible when resizing.
'
'-(Bug fix) If the navigation buttons were enabled and set to Theme Buttons, and you
'           switched the Control Type during runtime to a mode where they were hidden,
'           and then switched back, they would not reappear.
'
'-(Bug fix) Switching from Dir+Files to Files Only during runtime caused an app crash
'           in some circumstances. Completely bizarre, just changing the order fixed it.
'
'-(Bug fix) If the DetailsPane/PreviewPane had their height/width set to Locked, then
'           were hidden, then turned back on, the sizer would become visible again, with
'           the popup menu incorrectly showing it to still be locked.
```

----------


## fafalone

*Project Update: Version 8.1 Released 25 April 2020*
*Updated to Version 8.1 on 4/25 after initial 8.0 release on 4/23:* A compile-stopping error was found in the 8.0 release: A parenthesis was in the wrong spot and preventing compiling; it's trivial to fix when you go to compile. How the test compile worked before the upload remains a mystery. It's trivial to fix, but since I needed to update the download anyway, there were a few significant features that were ready to go so I went ahead and updated the version instead of just posting a revision.

In addition to the critical bug fix, this version also adds the ability to configure the InfoTips- you can disable them entirely, limit them to the simple LabelTip the ListView provides, continue with the Explorer-style ones (the default), or supply a custom one. Then options were added for a few ListView style flags that should really have been available, and another very minor bugfix.



```
'New in v8.1 (Released 25 April 2020)
'
'-It's now possible to configure InfoTips with the InfoTipMode property. You can
' disable them entirely, only use the ListView's default Label Tip, use the Explorer
' style extended ones with several items properties, or supply a custom one via the
' new QueryCustomInfoTip event (only raised if InfoTipMode is set to custom).
'
'-Added SimpleSelect option to toggle the LVS_EX_SIMPLESELECT style. Sets whether, in
' Med/Lg/XL Icon views, when Checkboxes are enabled, pressing the space bar checks and
' unchecks all selected items (True-Default) or only the focused item (False. Other view
' modes are not effected by this style and do the former.
'
'-Can now also toggle the basic ListView styles NoLabelWrap, ShowSelAlways, AutoArrange,
' and AlignTop. For AlignTop, if you set it to False, AlignLeft is used instead.
'
'-(Bug fix) Changing AllowRename during runtime was inverted. False allowed renames, and
'           True did not.
'
'-(Bug fix) Fixed out of place parenthesis triggering compile error.
'
```

Sorry for another immediate update, no matter how much I test for bugs and sit around thinking of what to add, it seems I *always* manage to miss a bug and immediately think of a bunch of "oh damn I should have added _____" things immediately after posting a new version  :Eek Boom:  :Sick:  :Cry:  :Confused:

----------


## fafalone

*Project Updated with Major Bug Fixes for History Buttons and more*
*Updated to Version 8.1 Revision 1*

To better support Unicode and some virtual locations, the method folders were loaded on double-click was changed. Somehow I failed to notice this broke the history function; no entries were added, and the back/forward buttons stayed disabled. This change also caused the 'Up' button to get stuck on disabled after getting to the root. It's always something.  :Blush: Further bug fixes include renaming files when extensions are hidden (wasn't working), a bug where the themed Back/Forward buttons (on the left or in the box) didn't show up if you started in Files Only mode then switched to Dir+Files, and a bug where dropping on libraries from the 'Libraries' main folder wasn't working. Added a few small features.

Side note, in the DemoEx demo, I added code to demonstrate usage of the new ShellTreeInLayout feature from the recent new version (to show/hide a ShellTree control as a normal layout option within the ShellBrowse control). 


```
'New in v8.1 R1 (Released 30 April 2020)
'
'-DragOver in the Library home now has e.g. "Move to Documents" instead of just
' the default "Move here" tip.
'
'-Cleaned up dropping so that if the target can't be dropped on, it fails with a
' skip of the drop handler and status message, instead of just erroring (silently).
'
'-Switched to using IShellItem.GetDisplayName SIGDN_NORMALDISPLAY instead of using
' PKEY_ItemNameDisplay for the displayed name; the latter was including the '.lnk'
' for links, which is normally hidden.
'
'-The sizer bar for the Preview Pane now covers the whole control height, so that
' the user doesn't see the top and bottom, which could be confusing. The Details
' Pane sizer already had this behavior.
'
'-(Bug fix) If you started in Files Only mode, then switched to Dir+Files, if your
'           Navigation Buttons were in ThemeButton mode, they would not be shown.
'           If the mode was ThemeButtonInBox, the spacing would be created, but the
'           actual buttons weren't drawn.
'
'-(Bug fix) If the current folder is the Libraries home folder, dropping items on the
'           library items wasn't working.
'
'-(Bug fix) Double-clicking on a folder to navigate was changed to a different method,
'           in order to better support Unicode and some virtual locations, and this
'           broke history; no items were added.
'
'-(Bug fix) Also due to the above change, once the Desktop was reached and 'Up' was
'           disabled, it would not become re-enabled when navigating elsewhere.
'
'-(Bug fix) Ensured 'Up' is disabled when reaching the root of a custom root.
'
'-(Bug fix) Renaming files when extensions were hidden broke at some point.
```

I'm honestly just disgusted with me missing the appearance of completely unexpected bugs whenever anything is changed; once again sorry for the buggy release.  :Blush:

----------


## MountainMan

Some dumb questions...

In the first 2 demo projects you have, when I highlight the ShellBrowse control in the form in the IDE I get 50 or more properties I can set. When I have the DemoEx project in the IDE and I look at the user control properties, there are only 10 for ucShellBrowse and for ucShellTree. The same is true for the ShellBrowse controls in the DemoVB project.  Why did you do this and how?

Second, is there any documentation for the events, properties, methods, etc. in the ShellBrowse and ShellTree controls? I see where you document everything in your changelog but it is tedious to have to work through all of the changes over time just to figure out how to use it now. To an extent, I don't care about the sequence and timing of bug fixes and feature additions, I want to use it as it exists now (or whatever time I use it).

I know you have put many years of work into these controls and I am grateful that y are sharing them with everyone. I would just like to be more efficient in my use of them. Thanks.

----------


## MountainMan

Drop Question - In your 1st demo, you have an event handler for ucShellBrowse1_DropFiles. If I drag some files off the form and then come back and drop them on the same form, this event is triggered. However, when I highlight some files in Explorer and drop them on your form, the event doesn't fire. Is this how it is supposed to work?

----------


## fafalone

Are the controls striped when you can't see their properties? If so close and reopen the form. That's usually caused by changing the control code while the designer is open, or the impossibly complex bug related to adding additional controls on a multi-control form with a Sub Main also containing public variables or APIs defined in both a UC and a TLB (see Known Issues in Post #2).

If it's not one of the above, it's not a condition that exists on the windows 7 pc I develop it on or the Win10 laptop I test it on (I checked both again just now). I see the full set of properties for all demos on my systems; so need to know more about the circumstances here to try to recreate the issue.


Documentation is limited to the list and descriptions right now. All the properties have descriptions in the IDE, and all events and public methods are documented in post #4 of this thread.

----------


## fafalone

> Drop Question - In your 1st demo, you have an event handler for ucShellBrowse1_DropFiles. If I drag some files off the form and then come back and drop them on the same form, this event is triggered. However, when I highlight some files in Explorer and drop them on your form, the event doesn't fire. Is this how it is supposed to work?


No... but that's also not an issue present on my machines, can you turn on debug logging?

Although I can't seem to test this on Win10 right now as dragging and dropping seems to be entirely disabled in the IDE for all programs (permissions issue, can't get VB to not run as admin, and can't get explorer to run as admin). But it was working fine when I was testing the new events and other recent changes to drops. It works in the compiled exe, give me a minute to turn on file debug logging to see if the event fires (update: it does).

Honestly it sounds like Microsoft has once again pushed a 'minor update' that broke a ton of stuff =/

----------


## MountainMan

Could the drop issue be one of differing permissions? I know Explorer runs unelevated and I was just running your demo in the IDE so it was elevated. I re-ran my little test with the compiled version and it works so the problem is transfer between elevated and unelevated processes. I don't know if there is an easy fix for that or not.

BTW, when I did the test, I dropped a file from Explorer onto your control and although the event fired, before it did, the Shell popped up with a warning that I dropped a file into a folder where the file was the same. I can deal with that myself so I was wondering if there is a way to turn that off. The full path was passed through to the event handler regardless of whether I responded with Skip or Cancel to the shell prompt.

----------


## MountainMan

> Are the controls striped when you can't see their properties? If so close and reopen the form. That's usually caused by changing the control code while the designer is open, or the impossibly complex bug related to adding additional controls on a multi-control form with a Sub Main also containing public variables or APIs defined in both a UC and a TLB (see Known Issues in Post #2).
> 
> If it's not one of the above, it's not a condition that exists on the windows 7 pc I develop it on or the Win10 laptop I test it on (I checked both again just now). I see the full set of properties for all demos on my systems; so need to know more about the circumstances here to try to recreate the issue.


I am running Windows 10 version 1909. I haven't modified your code. I just ran the demos as your wrote them and I get the huge difference in visible properties. if I don't screw this up, below are screenshots of the 2 demos in the IDE.

----------


## MountainMan

> Documentation is limited to the list and descriptions right now. All the properties have descriptions in the IDE, and all events and public methods are documented in post #4 of this thread.


Thanks. I totally overlooked that. When I get a notice of an update I go to the bottom of your original post #1 and I get the zip file. For some reason it never dawned on me that perhaps you had been updatnig subsequent posts including #4.... :Blush:

----------


## fafalone

> Could the drop issue be one of differing permissions? I know Explorer runs unelevated and I was just running your demo in the IDE so it was elevated. I re-ran my little test with the compiled version and it works so the problem is transfer between elevated and unelevated processes. I don't know if there is an easy fix for that or not.
> 
> BTW, when I did the test, I dropped a file from Explorer onto your control and although the event fired, before it did, the Shell popped up with a warning that I dropped a file into a folder where the file was the same. I can deal with that myself so I was wondering if there is a way to turn that off. The full path was passed through to the event handler regardless of whether I responded with Skip or Cancel to the shell prompt.



You can't drag and drop between elevated and non-elevated processes no; this effects all apps. There's a way around it, but it has to be done at the whole-app level (uiAccess = True in the manifest and digitally sign the code), or an intermediate app (see here)

There's no way to turn off that warning, no, unless there's some registry setting somewhere that turns it off in Explorer (as that's what's handling the drop, so it's as if you dropped it in the same location in Explorer, which also displays that message). 

Note that the drop message is also going to notify you of drops that are on subfolders, or programs, so aren't copied to your current folder in any case, so you should be performing logic on the drop data or just watching the ItemAdded event instead.

As for properties, I'm going to have to start updating Windows, because I definitely can't reproduce it on any machine or VM I have right now.

----------


## fafalone

*Project Update: Version 8.2 Beta Released*
There's a major issue with Custom Roots where you want them enforced, it's basically broken beyond repair besides opening the root once and then children. So I needed to release the next version sooner than I planned so a fix for that is available. But: Was in the process of completely overhauling the column selection and search functions. So I'm leaving V8.1-R1 up and releasing 8.2 as a Beta until I can test it more thoroughly, through I have done basic testing on both Win7 and Win10. 



Hopefully everything is working good as it seemed to be in my initial tests, but after the last few fiascos I figured I ought to leave a known-stable version up until some more testing is done.

----------


## softv

Ref: http://www.vbforums.com/showthread.p...=1#post5477911


Hi fafalone, 
Your ucShellBrowse control is super-fascinating. Really. Its absolutely awesome. And, as pointed out by you (please see reference thread above), I was able to get all different font styles for 'BahnSchrift' (as well as for the other fonts which have multiple styles too) quite easily. *Thanks a TON*. So, as of now, for me, this seems to be the only way by which I can get the desired information (in the same precise manner, as reported in the 'Fonts' folder by Windows). But, if you/anybody can get this particular desired information by API, etc. itself, without any dependency on your control, that would be great too. 

My best wishes for all your noble endeavours. 

Prayers and Kind Regards.

----------


## fafalone

The way the control works is just to enumerate the items and use the system Property Store.
The properties in the fonts folder are:
System.ItemNameDisplay
System.Fonts.ActiveStatus
System.Fonts.Category
System.Fonts.DesignedFor
System.Fonts.FontEmbeddability
System.Fonts.Styles
System.Fonts.Vendors
System.Fonts.CollectionName
System.Fonts.FamilyName
System.Fonts.FileNames
System.Fonts.Type
System.Fonts.Version

If you just wanted to do it for the fonts folder, here's a way to list all those properties:
(Requires just oleexp.tlb, and either the add-on mIID.bas in the oleexp download or the IIDs/FOLDERIDs/BHID GUIDs copied from there or the control)


```
Private Declare Function PSGetPropertyKeyFromName Lib "propsys.dll" (ByVal pszName As Long, ppropkey As oleexp.PROPERTYKEY) As Long
Private Declare Function PSGetPropertyDescription Lib "propsys.dll" (PropKey As oleexp.PROPERTYKEY, riid As UUID, ppv As Any) As Long
Private Declare Function PSFormatPropertyValue Lib "propsys.dll" (ByVal pps As Long, ByVal ppd As Long, ByVal pdff As PROPDESC_FORMAT_FLAGS, ppszDisplay As Long) As Long
Private Declare Function SysReAllocString Lib "oleaut32.dll" (ByVal pBSTR As Long, Optional ByVal pszStrPtr As Long) As Long


Private Sub ListFonts()
Dim siFontFolder As IShellItem
Dim pEnum As IEnumShellItems
Dim siFont As IShellItem
Dim si2Font As IShellItem2
Dim pcl As Long
Dim pStore As IPropertyStore
Dim ppd As IPropertyDescription
Dim sList As String

oleexp.SHGetKnownFolderItem FOLDERID_Fonts, KF_FLAG_DEFAULT, 0&, IID_IShellItem, siFontFolder
siFontFolder.BindToHandler 0&, BHID_EnumItems, IID_IEnumShellItems, pEnum
Do While pEnum.Next(1&, siFont, pcl) = S_OK
    Set si2Font = siFont
    si2Font.GetPropertyStore GPS_BESTEFFORT Or GPS_OPENSLOWITEM, IID_IPropertyStore, pStore
    sList = "Font: " & GetPropertyDisplayStringByName(pStore, "System.ItemNameDisplay")
    sList = sList & ",ActiveStatus=" & GetPropertyDisplayStringByName(pStore, "System.Fonts.ActiveStatus")
    sList = sList & ",Category=" & GetPropertyDisplayStringByName(pStore, "System.Fonts.Category")
    sList = sList & ",DesignedFor=" & GetPropertyDisplayStringByName(pStore, "System.Fonts.DesignedFor")
    sList = sList & ",FontEmbeddability=" & GetPropertyDisplayStringByName(pStore, "System.Fonts.FontEmbeddability")
    sList = sList & ",Styles=" & GetPropertyDisplayStringByName(pStore, "System.Fonts.Styles")
    sList = sList & ",Vendors=" & GetPropertyDisplayStringByName(pStore, "System.Fonts.Vendors")
    sList = sList & ",CollectionName=" & GetPropertyDisplayStringByName(pStore, "System.Fonts.CollectionName")
    sList = sList & ",FamilyName=" & GetPropertyDisplayStringByName(pStore, "System.Fonts.FamilyName")
    sList = sList & ",FileNames=" & GetPropertyDisplayStringByName(pStore, "System.Fonts.FileNames")
    sList = sList & ",Type=" & GetPropertyDisplayStringByName(pStore, "System.Fonts.Type")
    sList = sList & ",Version=" & GetPropertyDisplayStringByName(pStore, "System.Fonts.Version")
    Debug.Print sList
    Set pStore = Nothing
    Set si2Font = Nothing
    Set siFont = Nothing
Loop
End Sub
Private Function GetPropertyDisplayStringByName(pps As oleexp.IPropertyStore, szProp As String, Optional bFixChars As Boolean = True) As String
'Gets the string value of the given canonical property; e.g. System.Company, System.Rating, etc
'This would be the value displayed in Explorer if you added the column in details view
On Error GoTo e0
Dim lpsz As Long
Dim ppd As oleexp.IPropertyDescription
Dim pkProp As PROPERTYKEY
If (pps Is Nothing) = False Then
    PSGetPropertyKeyFromName StrPtr(szProp), pkProp
    PSGetPropertyDescription pkProp, IID_IPropertyDescription, ppd
    If (ppd Is Nothing) = False Then
        Dim hr As Long
        hr = PSFormatPropertyValue(ObjPtr(pps), ObjPtr(ppd), PDFF_DEFAULT, lpsz)
        SysReAllocString VarPtr(GetPropertyDisplayStringByName), lpsz
        CoTaskMemFree lpsz
    End If
    If bFixChars Then
        GetPropertyDisplayStringByName = Replace$(GetPropertyDisplayStringByName, ChrW$(&H200E), "")
        GetPropertyDisplayStringByName = Replace$(GetPropertyDisplayStringByName, ChrW$(&H200F), "")
        GetPropertyDisplayStringByName = Replace$(GetPropertyDisplayStringByName, ChrW$(&H202A), "")
        GetPropertyDisplayStringByName = Replace$(GetPropertyDisplayStringByName, ChrW$(&H202C), "")
    End If
    Set ppd = Nothing
Else
    Debug.Print "GetPropertyDisplayStringByName.Error->PropertyStore is not set."
End If
Exit Function
e0:
    Debug.Print "GetPropertyDisplayStringByName->Error: " & Err.Description & ", 0x" & Hex$(Err.Number)
End Function
```

Now if you needed the additional information on the individual multi-style fonts (where you'd double click one in the control and then an entry would show up for each), the quickest shortcut would be to check the Folder attribute (siFont.GetAttributes SFGAO_FOLDER, dwAttribs: If (dwAttribs And SFGAO_FOLDER) = SFGAO_FOLDER Then), and then just take siFont and enumerate that in the same way that was done for the font folder...
siFont.BindToHandler 0&, BHID_EnumItems, IID_IEnumShellItems, pEnum2
Do While pEnum2.Next(1&, siSubFont, pcl) = S_OK
etc.

--
It's possible to use APIs to make direct calls on the VTable as well to eliminate the need for the TLB (which only needs to be present for the IDE, doesn't need to be included with the exe), but it's quite a bit more work.



Side note:
It's possible to show previews for fonts in the control, but the usual methods of reporting the full parsing name don't actually return the font file name, so the preview doesn't get loaded. I haven't updated the download yet, but anyone who wants to fix that,
In ShowPreviewForFile, replace everything between On Error Goto e0 and If (ipv Is Nothing) = False Then with


```
objpic.Cls
If (isi Is Nothing) Then
    DebugAppend "no isi"
    If sFileIn <> "" Then
        sFile = sFileIn
    End If
Else
    sFile = GetShellItemFileName(isi, SIGDN_DESKTOPABSOLUTEPARSING)
End If

sExt = tSelectedFile.sExt
If sExt = "" Then
    sFile = GetShellItemFileName(isi, SIGDN_DESKTOPABSOLUTEPARSING)
    If (Len(sFile) > InStr(sFile, "\")) And (InStr(sFile, "\") > 0) Then
        sExt = Right$(sFile, Len(sFile) - InStrRev(sFile, "\"))
        If InStr(sExt, ".") Then
            sExt = Right$(sExt, (Len(sExt) - InStrRev(sExt, ".")) + 1)
        Else
            Exit Sub
        End If
    End If
    If sExt = "" Then Exit Sub
    DebugAppend "ShowPreviewForFile::Used alt file name method to get " & sFile
End If
```

----------


## MountainMan

I have a request for your next update. Throughout your .ctl file you define SYSTEMTIME and FILETIME UDT's as oleexp.SYSTEMTIME and oleexp.FILETIME respectively except once in line 20468 and twice in line 20470. It would be helpful to make those changes so we avoid a mismatch when we have our own definitions of these two types. Thanks.

----------


## softv

> The way the control works is just to enumerate the items and use the system Property Store.
> ... .. . 
> Now if you needed the additional information on the individual multi-style fonts ... .. .
> It's possible to use APIs to make direct calls on the VTable as well to eliminate the need for the TLB (which only needs to be present for the IDE, doesn't need to be included with the exe), but it's quite a bit more work. ... .. .
> Side note:
> It's possible to show previews for fonts in the control, ... .. .


*Fabulous.* Works like a charm. Goes to show how your tremendous work - diving deep into the "property system" - has made things ever so simple for requirements like mine (and very many others' as well). Feeling very *grateful* and happy, sitting here and marvelling at the work done by you. 


And, thank you so... much for explaining further - on how to get the 'additional information on the individual multistyle fonts' and 'previews for fonts'. Much appreciated. Will try them out very soon.

----------


## fafalone

Released v8.2 Final since no major issues popped up. Included a couple small fixes, including the previewer, and the change requested by MountainMan.



```
'New in v8.2 Final (Released 23 May 2020)
'
'-The file previewer now checks an alternate way to get file parsing names (a
'  *very* unusual one) that allows certain actual files represented virtually
'  to have their previews shown. So far, this is only known to apply to fonts
'  in the Fonts folder, but may be more widely applicable if there's similar
'  folders elsewhere.
'
'-(Bug fix) In the column right-click menu, in some circumstances some properties
'           would appear more than once.
'
'-(Bug fix) Small icons, sometimes, would load blank file type icons in Med/L/XL
'           icon modes. Switched to using the thumbnail routine since there's
'           no practical difference. There's sometimes a similar problem with
'           exe's so I did the same thing, but that appears unresolved and I
'           haven't been able to determine what makes a particle exe fail, since
'           all the Demo exe's of this control have the same icon, but some fail
'           and some do not.
```

Original info:

Here's a shot of the new Advanced options for the column manager; showing the super-expanded property list that includes GPS properties, then using the filter bars to search for them (be sure to read changelog for full details!):


Full Changelog:


```
'New in v8.2 (Released 17 May 2020)
'
'-The Column Select popup now has a dropdown menu on the Property column header
' which allows a new 'Advanced mode'. In this mode, *all* properties are loaded.
' Many of these properties are not meant for columns, but some are, for instance
' this mode has Longitude and Latitude columns for photos with GPS data. Since
' many have duplicate labels, an additional column with the System Name will be
' added to the list. Some don't have friendly names, so the canonical name appears
' in both columns. Sorting is also enabled for both columns.
' You can disable this with User Option bEnableColumnAdvancedMode.
'
'-Added a toggle for a FilterBar in the Column Select popup, allowing you to
' search for specific columns. Like the filters for the file list, you can start
' with the first letter(s) or use wildcards (*) to match partials inside.
' The filterbar will be present and working for the System Name column if the
' Advanced mode described above is enabled.
'
'-It's now possible to conduct a search of all Libraries from the library root
' folder. Even Explorer on Windows 7 didn't support this because of the way the
' libraries are structured.
'
'-When a search is completed, there's now an option to add a footer bar, which has
' options to repeat the search in several places. Option ShowFooterAfterSearch.
' The 'Custom' option loads a dialog, with its own GUID so it doesn't effect your
' app. If you do want it to effect your app, or you want to ensure the last place
' isn't automatically brought up in other ucShellBrowse controls, you can get/set
' the Client GUID with the DialogGUID property (not shown in Properties window).
' Note: The host form is *not* notified of a click to these buttons.
'
'-There's now a FileSearchStart event that notifies the host that a file search
' has started, along with the details of the search. Changing the details will not
' have any effect.
'
'-This control now implements IObjectSafety to mark it safe for untrusted calls
' and data, as controls such as Krools Common Controls replacements do. This was
' not done previously because it was not compatible with the self-sub code (it
' would completely prevent subclassing and callbacks while throwing many errors),
' but LaVolpe was able to figure out a fix for the issue (number of VTable entries
' in zProbe).
'
'-The Custom Folder, if already created (this is *not* search results, it's the
' single custom folder created with CreateCustomFolder), can now be opened with
' DisplayCustomFolder. This is primarily for being able to add a custom item to a
' accompanying ShellTree control to be able to navigate back to it from there.
' This can also be done (also new) by passing "*CUSTOM" as the path for navigating
' with the BrowserPath property.
'
'-Icons in the Preview Pane seemed to be a little small, so I switched to another
' preview method for them that should load the largest applicable size.
'
'-(Bug fix) Custom root paths weren't being processed correctly, leading to being
'           unable to load the root folder from the dropdown, and the parent being
'           incorrectly added as a child even when navigating out of root was blocked.
'
'-(Bug fix) If the footer was enabled, and it was created in a folder with few
'           enough items to be on screen, it would stay on screen when changing
'           folders and new items would just be drawn on top of it.
'           In a mostly related bug, if it was off screen, it wouldn't reappear
'           in a new folder sometimes.
'           It's now re-created each time, including being re-created when you
'           navigate away from search results, replacing the custom search one.
'
'-(Bug fix) There was a needless redraw of the Details Pane on startup.
'
'-(Internal issue) The group header/footer text for item count was defined in the
'                  procedure instead of with the module-level string group.
```

----------


## fafalone

*Version 8.3 Finalized*
Found no major issues, so posted the new version in the main post. Only changes were a small issue where in Windows 10, the '3D Objects' item in This PC for some reason reports the properties of the main hard drive, and text positioning in the Details Pane when multiple items are selected (this seems to date back several versions). 

*Version 8.3 Beta*

Need to do a lot of testing, but since the list of known issues has grown quite long, I wanted to release the next version as a beta. Everything seems good to go on my development system, but I haven't tested several other systems like normal yet. If any issues pop up, be sure to let me know.



```
'New in v8.3 Final (Released 27 Aug 2020)
'
'-(Bug fix) On Windows 10, the 3D Objects item in This PC for some reason has a
'           property store that returns free space, percent full, and space used
'           values for the main hard drive. The progress bar showing % full is
'           now hidden for items like that which don't return a 'Decorated Free
'           Space' value ("x bytes free of y").
'
'-(Bug fix) Spacing and sizing in the Details Pane when multiple items were
'           selected was bad; some text was cut off or on top of other text.
'
'New in v8.3 (Released 25 Aug 2020)
'
'-Added colored title bar to the Column Select popup and Search Options popup
' to provide a visual cue indicating it can be moved around.
'
'-There's a new option called RestrictViewModes. You can specify that certain
' view modes be hidden from the View Menu and unavailable to switch into via
' the ViewMode property. At least one option must be available, if none are,
' Large Icon view is enabled.
' It is your responsibility to ensure the startup view is not restricted, as
' that will not be blocked, and that if you make Tile and Contents the only
' possible views, that ComCtl6 is present, since those are unsupported without
' it. You can specify a list formatted like 0,1,2,... or 0123..., as follows:
'   0=XLIcon, 1=LgIcon, 2=MedIcon, 3=SmIcon, 4=List, 5=Details, 6=Tiles,
'   7=Contents, 8=Thumbnails
'
'-Added EnableLayout option, to toggle whether the Layout submenu appears in
' the View Menu, without needing to disable each item individually (which is
' still possible and would have the same effect).
'
'-In the Details Pane, you can now highlight and copy the values of properties
' that are read-only. The box is still locked, so it won't appear enabled or
' allow typing. This can be disabled with the bAllowCopyFromReadOnlyProps
' user option in the section below this changelog.
'
'-Changed the Bookmarks menu to only show the add or remove menu item for the
' current folder, instead of showing both and having one disabled.
'
'-There's now an option, AutoHideControlBox, for whether or not to automatically
' hide the Control Box (Up, View, Bookmarks, Search, and Back/Fwd in certain
' modes) when the UserControl width becomes too small, to allow a smaller size
' without the directory dropdown disappearing. Default is True. A new User
' Option, cyMinCombo, will apply when set to False.
'
'-Improved spacing/alignment of Details Pane properties. The biggest change here
' is no longer truncating long property names in the first column, like with an
' mp3's "Contributing Artists" that would get cut off.
'
'-Added event FileSearchPopup. This fires when the Search Popup is about to be
' shown either from double-clicking the control box or through the menu. It
' gives the current text for the control box search box, and the fCancel option
' which will prevent the popup from being shown if fCancel is set to non-zero.
' This is intended to allow you to replace the built-in Search Options screen
' with your own. You'd hide the default with this event, show your own, then
' use it to execute a custom search, using ExecFileSearch, ExecFileSearchEx,
' or ExecFileSearchExB (advanced options require manually building your own
' ICondition object. See GetCondition to see how to begin that path).
'
'-(Bug fix) If the Navigation Buttons (Back/Forward) were set to regular
'           command buttons (SBNB_Normal), the Forward button did not work; at
'           some point the click code was inadvertently deleted.
'
'-(Bug fix) For the option to include a toggle for a ShellTree control in the
'           layout menu, an icon was created and added to the control, but was
'           not assigned to the menu item.
'
'-(Bug fix) Without ComCtl6, the dropdown button on column headers is not
'           available, so Advanced Mode in the Column Select popup was not
'           accessible. It's now available by right-clicking the header.
'           -Related, since Group Mode is not available without CC6, the filter
'            bar is now hidden, pending a re-write to not rely on grouping.
'           -Neither of these change anything if Comctl6 is present.
'
'-(Bug fix) During runtime, if you switch NavigationButtons to Theme Buttons,
'           regular (not in box), from any of the other styles (or disabled),
'           the Back button would not be drawn.
'
'-(Bug fix) If you go to Computer/This PC, set the Group Mode to None, then
'           switch back to Category, then navigate to another folder, an error
'           occured and the folder didn't load.

'-(Bug fix) FullRowSelect couldn't be changed during runtime. There may have
'           been similar bugs where an extended style couldn't be disabled
'           during runtime; I adjusted all of them just in case.

'-(Bug fix) When switching control modes during runtime, when the Back/Fwd
'           buttons were drawn in theme mode (in box or on the left), they'd
'           initially be drawn as disabled when they should be enabled, until
'           a mouseover caused it to update to the correct status. They're now
'           drawn in the correct state from the start.
```

----------


## fafalone

*Project Updated to Version 8.3 R2*
Fixed bug in sort order:

Not sure how this was overlooked for so long, but there was a bug in the sorting algorithm for extended columns. If an item didn't have any value for the current column, it would trigger a break in the sorting. Everything above it would be sorted correct, and everything below it sorted correct--- but like it was two different lists, e.g. CEG __ ABDF.

Also, Type/DateCreated/DateAccessed/DateModified should be sorted using the IShellFolder sort, so that it's a little faster and folders are listed separately from files, but instead were sorted as extended columns.

Finally, now all columns have folders kept separate when sorted. Previously only the default columns (Name, Size, Type, Date Created/Accessed/Modified), or supported columns where AlwaysSortWithISF was enabled, were shown this way, but now all columns are without any significant performance impact.



```
'New in v8.3 R2 (Released 09 Sep 2020)
'
'-Implemented folder separation for extended columns. Previously, besides the
' default columns (Name,Size,Type,DateC-A-M), folders would be mixed in with
' all the items instead of appearing before or after. Now, like the defaults,
' all columns will show folders separately.
' This was tested in folders of several thousand items and did not add any
' significant performance hit; under a second for 3,000 items. But if this was
' causing problems, the block that checks folder status in LVSortProc->stdsort
' is easily removed.
'
'-(Bug fix) Sorting for Type and the three default Dates was not being done with
'           IShellFolder.CompareIDs.
'
'-(Bug fix) Sorting order for extended columns could be incorrect if any items
'           in the folder had no value for the given column.
```

----------


## fafalone

*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.



```
'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.
```

----------


## fafalone

*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)



```
'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.
```

----------


## fafalone

*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:

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:



Here's a full list of changes:


```
'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!  :wave: 

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

----------


## Steve Grant

I can't get past any of the 



```
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!! :Smilie:

----------


## fafalone

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  :Frown: 

---
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.

----------


## Steve Grant

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.

----------


## fafalone

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  :Frown: 

*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*

----------


## Steve Grant

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.

----------


## fafalone

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.

NOTE: This version is for testing only; so many features are broken since it's just to test something highly specific.

EDIT: Removed attachment. See latest experimental release a few posts down.

----------


## Steve Grant

This didn't really make any improvement so I went back to some old controls I've had for at least 20 years from Sky Software. These are WXFLDVW.Ocx and WXFILVW.OCX. Folderview  & Fileview respectively. I  just popped them both on a form, linked them and then selected my music folder - 8 Secs complete with the correct VLC Icon. This was in IDE compiled it was just over 1 second. No metadata here but then there is none in the tests I have been doing for you. Incidentally the files are shown correctly sorted from the start.

I have noticed that the filenames in DemoVB are slightly corrupted for a while and not of the correct number when first shown. They then spring into sorted with the correct (I assume) number.

The linking is just as below in case you were wondering. The ocx's come to 900K in total.



```
Private Sub Form_Load()
    FolderView1.FileView = FileView1
End Sub
```

----------


## fafalone

Well I might be making some progress... it seems both IShellFolder/IEnumIDList and IShellItem/IEnumShellItems have a best case scenario of 15s or so to load 50,000 items, just reading off the names.

So I made a version that does the initial listing with FindFirstFileEx, which cuts the initial read down to 8-10s... but the problem has become, if you don't use WM_SETREDRAW to turn off redrawing, it will redraw after each item, making it extremely slow (over a minute), but now when I go to turn it back on, the call is taking 15 seconds, making the total around 23-25s. 

But I'm close. Once this redraw issue is solved my control will match the 8-10s time of other FindFirstFile based controls at least.

----------


## Steve Grant

Obviously I don't know your test machine/OS but this is what I get from a freshly started PC (no files in cache) using Win 10 Home 2004/i7 7700K @ 4.2 GHz from a standard 2TB sata hard drive. Compiled.
To not get bogged down with the slowness of listviews/listboxes I use the McListbox.ctl from Jim Jose from PSC and load the filenames into an array for sorting then dump them into the McListbox thus



```
 lstFiles.AutoRefresh = False
    For j = 0 To UBound(arFiles)
        lstFiles.AddItem arFiles(j)
    Next
    lstFiles.AutoRefresh = True
```

I will try dumping directly and come back and edit this. I have to shut down to clear the cache.
....Well as you can see dumping direct is a little quicker but the tracks are not sorted.

Let me know further what, if anything, I can do to help.

----------


## georgekar

Check my RecDir class, https://github.com/M2000Interpreter/...ter/RecDir.cls
I use this for my own control for files. When we see something (a folder's items) and click for any other folder, then a new recdir start to made a internal list, but until that list end we see the "old" list, and maybe we can cancel the first search.
The multitascking achived because we use the RecDir with events. We get the result by an event.

----------


## fafalone

So for another experiment, I switched to an even lower level set of calls for enumerating directories (NtOpenFile/NtQueryDirectoryFile). The main loop does as little as possible, and the issue with redrawing seems to be resolved. 

This is probably going to wind up being the floor... best possible outcome without going to full virtual mode.

On my system, it's able to load 57,000 items in 13s all in (opening the folder until you can start interacting with the files), and 21,000 files in 3.5s, and 7,500 items in 1.1s. 

In the LVLoadFolder sub, you'll see it redirects to the new routine, LVLoadFolderExB; you can remove that redirect if you want to look at the fully stable and feature-complete best case scenario, but that's clocking in at 21,000 files in 6.6s and 57,000 at 20s.


Not sure which way I'm going to go for the final release, but this beta shows the two options. Apart from the high performance re-direct, it has all the major updates made for the 9.0 release as well.

UPDATE:
Virtual locations can't be loaded with the low level APIs, so the redirect is set to use the regular method for things like Computer/This PC, the Devices and Printers folder, or Libraries, or attached media devices.
However, I found that the Fonts folder is also unsupported, so added a routine to check for folders that are regular disk locations, but unsupported. Right now that's only Fonts that I've seen, but if you find another, add it to the array in SetUnsupportedHPfLocs and let me know. Also couldn't load Search Results folders or zip files with the low level APIs; group view needs some reworking so if it's enabled when a folder is opened it falls back to the standard method. Implemented options for FoldersOnly/FilesOnly, filters for file names or folder names, and show hidden/show superhidden for the high performance part; it only added 300ms on the 57,000 items so definitely worthwhile.

UPDATE:
Group view for folders supported by the high performance routine is now enabled.
Fixed issue with Contents View
Fixed issue with loading icons after changing directories in Med/L/XL Icon View

*UPDATE (November 24th)*:
This should be the final beta. I've decided to integrate the new high performance method; it will be used under strict conditions for where it's supported (local disks, no virtual locations). For unsupported locations, the routine used is still a much better performer than it used to be (unless you enable column preloading), as it only loads most data on demand.

The new beta here fixes a whole bunch of bugs related to context menu commands. The keyboard actions for things like Delete weren't working with multiple items, and the right-click menu was all kinds of screwed up for a while now. All this just needs to be tested for virtual locations and media devices, then some general testing, and then I'll be able to finalize. 9.0 will be the best performing, most stable, and most complete version yet. Taking time to get it all right and all tested, so please report any issues with this new beta  :Smilie: 

(Edit: Removed Beta after final version release)

----------


## fafalone

*Project Updated to Version 9.0*

After putting in tons of work refining the high performance changes, I've gone ahead and released it as a major version update. As mentioned, the final version uses the High Performance Mode with low-level APIs where applicable, and the regular, but still new and much better performing, mode for everywhere else. The final compiled version has been loading 60,000 items in 10 seconds flat. 

This is a major update with significant new features. The biggest difference is performance. Previous versions became slow when loading directories with more than a few thousand files. The new version addresses this in 2 ways: First, the regular loading method defers loading most data until an item is scrolled into view for the first time. This creates a little lag when scrolling an item into view for the first time, but speeds up the initial time until you can start interacting with a folder. You can use the old way of loading all data first by changing the new ColumnPreload option to True. Second: Normal folders on local drives are now loaded using a special High Performance Mode. This uses a low-level API to dramatically speed up load times. The trade-off is that it only works, as stated, for normal folders on local drives. Network locations, virtual folders, search results, and a few other exceptions will fall back to the regular loading method (which as just described, is still much faster than the old version). This can be disabled by setting the HighPerformanceMode option to False.

There's a big change to Directory Only Mode / Directory Only w/ Controls: Previously you'd be stuck on top level folders; now when selecting a location, the directory dropdown will load the child folders, so you can continue navigating. There are some issues with the sort order here, I'm stuck on how to address them for now but it's a fairly minor issue, so I went ahead and included this new feature.

A number of minor new features and bug fixes rounds out the release; see the full changelog below for full details.


```
'New in v9.0 (Released 28 Nov 2020)
'(Includes changes from the public betas)
'
'-Added ColumnPreload option. To speed up performance, all columns besides name
' will only be loaded the first time an item is scrolled into view. To load them
' all first instead, set this option to True. In earlier versions, load time could
' go up exponentially; e.g. 7000 items would take ~8s, but 50000 items would take
' over 10 minutes (!). This only brings the 7000 item load time down to 4.5s, but
' brings the time to allowing interaction with 50000 items down to 15-20s.
' NOTE: This is unsupported in certain virtual locations. Libraries are supported,
'       but e.g. Network Connections is not.
'       Media devices like phones and cameras are not currently supported.
'       Unsupported locations will load as if this option was True-- how things
'       worked in all previous versions.
'-If not preloading, icons are now set on demand via a callback as well.
'
'-Added HighPerformanceMode option. This uses low-level APIs to load folders as
' quickly as possible. 5-10,000 items are loaded in under 2s, 60,000 items are able
' to be loaded in 10-12s. This method is highly limited in support: only regular
' file system locations on local drives are supported. Virtual locations, network
' resources, attached media devices, inside zip/cab files, and some special folders
' like Fonts are all unsupported. Directory Only/Directory Only + Controls will not
' use this mode. If ShowParentTreeInList is True, this mode is not supported. In the
' case of an unsupported folder, it falls back to the standard method of loading
' folders. The ColumnPreload option must also be False to use this.
'
'-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.
' You can change this behavior to be done in other modes, or never, through the
' new User Option nExpandSelectedFolderInDropdown.
' This feature is still a work in progress. Some folders will appear at the bottom
' of the list, while others will appear in the proper place, and opening Libraries
' will open included folders from their root, rather than under Libraries. This is
' way more complicated than it would seem, so it'll take a while to sort out all of
' the kinks, but I didn't want to delay the whole project for weeks or months while
' this is ongoing.
'
'-You now have the option to specify the column set when creating a Custom Folder.
' To use this feature, in the method where you call CreateCustomFolder, create an
' array of PROPERTYKEY keys, e.g. apk(), representing the columns you want displayed.
' Then when you call CreateCustomFolder, you call it as follows:
' ucSB.CreateCustomFolder "Title", Paths(), [Icon], VarPtr(apk(0)), UBound(apk) + 1
'
'-Added SelectColumnOnSort to highlight a column when you sort by it.
'
'-The color of the highlight can be set with the new ColumnSelectColor option.
'
'-Added icon for Status Bar option in the Layout menu.
'
'-Added PlaySounds option. If enabled, the system navigation sound plays (if set
' in the Control Panel), as well as the default beep / critical stop sounds (these
' were already present, but used the Beep command; they now look up the sound that
' is set in the Control Panel). If you want to enable/disable these sounds
' individually, there's a new value in the User Options section below these comments
' for each one. Default is enabled.
'
'-The Context Key will now bring up the Shell Context Menu (assuming the option
' EnableShellMenu is True).
'
'-For the Column Select popup, you can now right click an item to display the menu
' with the 'Send to top' option, instead of only being able to access it through the
' column header dropdown.
'
'-Switching between DirOnly[WithCtl]/DriveOnly during runtime/updating the design
' view was not possible since a ListView wasn't being created. These switches now
' work in both the IDE and during runtime.
'
'-Added the SearchPopupInMenu option, which adds an 'Advanced search' item to the
' layout menu to immediately show the Search Options popup. If the SearchBox option
' is set to True, and the control bar is hidden, and this option is enabled, just the
' 'Advanced search' item is added, since under those settings the two items would be
' identical in behavior.
'
'-The preview for the last displayed file is now cleared when a new folder is loaded,
' instead of staying up until a new file was clicked.
'
'-Previewing images is an ongoing challenge. What crops and zooms instead of scales
' seems to vary between Windows versions. IShellItemImageFactory shouldn't have been
' doing that, and should have returned the same image as IThumbnailProvider, but that
' has not been the case.
' The new first attempt uses IThumbnailProvider, which maintains aspect ratio as it
' displays images less than full size, and will not enlarge past full size. The hope
' is this behavior remains consistent with the various Win10 versions; if it doesn't,
' please give me a shout.
'
'-(Bug fix) A long-standing bug would either add or not add the 'Browse' option
'           to the Shell Context Menu based on whether the very first item was a
'           folder, instead of the currently selected item. Clicking it would work
'           properly, but it shouldn't have been enabled at all.
'
'-(Bug fix) For items like in Programs and Features that have URLs as properties,
'           the links were created but no action was taken when clicked. Now, the
'           default is to open the URL with the default browser. There's a new
'           event: ItemLinkClick, which reports the URL, and the fExec argument,
'           which allows you to override the open action by setting it to anything
'           other than 0.
'
'-(Bug fix) If BrowseZip was set to true, zip files were not being separated from
'           regular folders in the sort order. Additionally, sometimes regular files
'           were not getting separated either.
'
'-(Bug fix) GetValue calls were set as functions when the last release of oleexp
'           expected a sub.
'
'-(Bug fix) The 'Advanced Mode' option was missing from the Column Select dropdown
'           menu under the Property header.
'
'-(Bug fix) If you switched the Control Type from Dir+Files to FilesOnly during
'           runtime, and then back to Dir+Files, the Preview Pane would have its top
'           aligned with the top of the control instead of the top of the ListView.
'
'-(Bug fix) There *was* a bug that was showing blank icons for small icons in icon
'           view mode (sm/med/lg), so a thumbnail was used for those and .exe's
'           instead. But that bug mysteriously vanished, to be replaced by a bug
'           that would now draw tiny icons for .exe's.
'           I don't know what to do. This is an ongoing an bizarre issue. Windows
'           seems to alternate bugs in the images returned by the various ways of
'           getting thumbnails. Every time I get everything working and stop looking
'           at every possible icon scenario, even though no code changes, Windows
'           has conjured a new bug to start giving me the wrong icons. So I apologize
'           in advance if whatever images Windows is returning today isn't handled by
'           the current code. It was all working last I checked.
'
'-(Bug fix) The check for unsupported directories for High Perf was case sensitive,
'           so the compiled version on Win10 incorrectly ok'd Fonts.
'
'-(Bug fix) Renaming items was broken.
'           Also, cleared up some issues with renaming .lnk files beyond that.
'
'-(Bug fix) It seems way back in v7.3, some functions, like Delete stopped working
'           if more than 1 item was selected. This didn't apply if done through the
'           context menu.
'
'-(Bug fix) There seems to have been some sort of highly unpredictable issues around
'           which items the shell context menu was applying to. This may be related
'           to some circumstances that cause the IContextMenu module-level variable
'           for the popup menu to not clear correctly, loading the previously selected
'           items. It's now cleared at the start of the menu routine, instead of at
'           the end, where some errors might have skipped clearing it.
```

----------


## Steve Grant

Jon, a big improvement on previous versions - well done!

----------


## yereverluvinuncleber

Superb!

----------


## fafalone

Thanks fellas  :Big Grin: 

I'd like to go full virtual mode and speed things up even more, but going that way it would probably be quicker to rewrite the whole thing from scratch. In the mean time, I hope 10s flat for my 7200rpm SATA spinner to load the 60k item test is workable. By the way

So there's a couple minor updates posted... if you already grabbed R2 a few days ago, that's the one with bug fixes. R3 is just a super cool new way of integrating with the ShellTree control, no new fixes. 

*Project Updates*
*UPDATE TO v9.0 R2* (Dec 5th, 2020): Several small bugs popped up that I was going to hold off on and just address in 'Known Issues' but a bug that prevented Extended Thumbnails (e.g. MP3/FLAC album art, videos) from displaying an actual thumbnail instead of the file type icon after a directory change or refresh pushed this into 'update now!' territory. Also, it seems the control either never or years since had support for Thumbnails View as the startup view? All other views worked except this. Well now it works. 

UPDATE TO v9.0 R3 (Dec 9th, 2020): Ok so I usually don't update for a minor feature, but this one makes the control look too cool to sit around for weeks or months until the next update. The integration with ucShellTree now goes even further. Instead of obviously being two separate controls side by side, I've now added an offset and some events that let you do a perfect integration just like Explorer. It's fully implemented in the DemoEx sample:



So how's that work? Well, make sure you look through the sample in the DemoEx folder for all the details, but the basic idea is I added a property ListViewOffsetX that adds an X offset to the ListView, but not the Details Pane, Status Bar, or Control Bar. Then, I modified some properties and added events needed to support still being able to resize everything. And the demo shows all that, it can handle every resize like it used to; resizing the Shell Tree, resizing the Details Pane, resizing after showing or hiding any element, and so on. I think it looks really great now compared to the previous way you had to pair it with a tree; much more like Explorer now. 

Note: Setting the BackColor and ForeColor in the ShellTree control like in the picture on the right is a new feature in an update to that control released today as well. You'll need to grab that if you want to set the colors.

If you're not interested in this feature there's no need to upgrade; no bug fixes this time. But I still wanted to post it  :Big Grin: 

*UPDATE*: I did sneak in one bug fix after 4 DLs of the original R3; if you loaded Computer/This PC (or a media device root with drives) in Tile View, the next folder after that would repeat the file name on the 3rd line. Not that big a deal especially since it went away after a refresh or the next folder after that, but did want to patch it up before too long.

*UPDATE:* I had added a second little form to the sample in \Demo that has the control just set as a directory dropdown, it wasn't included in the zip. The main demo there worked fine but it gave the 'cannot load...Keep loading?' error and obviously if you clicked the 'DirOnlyForm' button that would error, so I just updated the zip with the form. This doesn't effect the control, just the demo. 



```
'New in v9.0 R3 (Released 09 Dec 2020)
'
'-There's now a ListViewOffsetX option, which allows you to specify an x offset
' for the ListView within the control. It is deducted from the width. This is
' designed to allow the Details Pane to appear below, and the Control Bar appear
' above, a paired ShellTree Control; see the new screenshot and implementation
' in the DemoEx demo.
' To assist, added the event DetailPaneHeightChanged for when the size of the
' pane changes within the control.
'
'-Also added a PreviewPaneWidthChanged event for completeness.
'
'-Note that for both the new events described above, toggling them on/off also
' raises the events, with a width/height of zero when turned off.
'
'-For even more events, there's now ControlTypeChanged, ToggleDetailPane,
' TogglePreviewPane, and ToggleStatusBar.
'
'-The Property Gets for Detail and Preview Pane width and height will now return
' zero as the current value if they're not turned on, instead of the last value
' before they were disabled.
'
'-(Bug fix) If you use Computer/This PC in Tile View, the next time you load a
'           different folder, the tiles display a repeat of the file name on the
'           3rd line, which looks particularly bad on folders which have a blank
'           second line. This is fixed for *almost* all circumstances, just have
'           fix navigating directly into non-top level mobile devices.
'           But in all cases, a refresh or navigating further resolves the issue.
'
'
'New in v9.0 R2 (Released 05 Dec 2020)
'
'-Changed the < = > symbols in the Search Options popup to words (Less than,
' Equal to, Greater than' and improved a few alignments.
'
'-In the Details Pane, if there was more columns available than properties meant
' to be displayed needed, the last column wouldn't expand to fill the space, so
' sometimes text was truncated needlessly. It will now detect this scenario and
' expand the last column *actually used* to the available space.
'
'-(Bug fix) Extended Thumbnails Mode would only load the thumb instead of the
'           icon if the view was changed to Thumbnails via the View menu in the
'           current folder. Changing folders or refreshing resulted in displaying
'           only the file type icon.
'
'-(Bug fix) The flag for unexpected errors in the high performance loader, the
'           LVLoadFolderExB sub, was not cleared, so if an error occured in one
'           folder, it would continue to be reported for all other folders and
'           thus triggering a fallback to the regular loader.
'
'-(Bug fix) One scenario that would trigger the above was that while there was a
'           check for the path being a zip, it only checked if the root of the
'           zip would be the the current folder; e.g. C:\file.zip and didn't
'           check if it was being asked to load an internal zip folder, e.g.
'           C:\file.zip\zipfolder, which of course can't be loaded by HPF either.
'
'-(Bug fix) For keyboard shortcuts, the status of all modifier keys wasn't being
'           taken into account: Ctrl+Shift+A would also trigger Select All, when
'           only Ctrl+A should.
'
'-(Bug fix) When using Tile View mode, folders are supposed to only have 1 extra
'           line, and this is how it appears when you switch into Tile View from
'           another view. But if you're already in Tile View and navigate to a
'           new folder, it adds a 2nd line that repeats the item name. This bug
'           has been around for a while; it's fixed now with workaround-- the
'           text was being correctly supplied as null, but to blank it out it
'           has to be a space. Still looking for a better solution.
'
'-(Bug fix) Setting the initial view mode in the IDE to Thumbnail View resulted
'           in no icons being loaded. This issue seems to date back years.
'
'-(Code) Several overlooked Debug.Print statements were changed to DebugAppend.
```

----------


## fafalone

*Project Updated to Version 9.0 Revision 4*

I found two significant bugs: Search queries containing a semicolon for multiple strings, e.g. *.jpg;*.bmp, would fail. Also, setting PreviewPaneWidth as well as DetailsPaneHeight through code did not work. Added ability to set back/forecolor on the Search Box, pulling up the full path in the dropdown (if enabled) is now a single click instead of a double-click.



```
'New in v9.0 R4 (Released 15 Dec 2020)
'
'-Added SearchBoxBackColor and SearchBoxForeColor option.
'
'-When the Directory Dropdown can be edited, a single click now sets the text
' to the full path and selects all, instead of a double click.
'
'-(Bug fix) The PreviewPaneWidth and DetailPaneHeight Property Lets were not
'           properly resizing the panels.
'
'-(Bug fix) Search queries containing a ';' (for multiple strings in a search,
'           such as '*.bas;*.cls') would fail.
```

----------


## fafalone

*Project Updated to Version 9.0 Revision 5*

Today has been a rough day for bugs... just discovered that using the New Folder item then renaming it resulted in the parent folder being renamed instead of the new folder. This seems to have popped up in v8.2, before that it worked.

Also fixed a minor bug where the control would get stuck if you double-clicked certain printers. 

Sorry for the frequent updates.  :Blush: 



```
'New in v9.0 R5 (Released 15 Dec 2020)
'
'-(Bug fix) Some objects, such as some printer objects in Devices amd Printers,
'           have properties that trigger the 'Browse' menu option to be enabled,
'           but obviously don't have anything to load. This broke the LVLoadFolder
'           at a bad point; the loading marquee would be stuck on and you couldn't
'           cancel or navigate elsewhere.
'
'-(Bug fix) If you used the menu option for New Folder then renamed it, it would
'           rename the parent folder instead of the new folder.
```

----------


## yereverluvinuncleber

Don't apologise. I am in awe of the time you are spending on these improvements to VB6. Yourself, Krool, La Volpe, Olaf and others contributing to make VB6 so much more than it is out-of-the-box. Things have bugs, you fix them. I will not complain.

----------


## fafalone

*Project Updated to Version 9.1!*

The main impetus for this release is an issue with previews; the new way introduced a few versions back of displaying previews in the Fonts folder for some unknown reason broke previewing fonts outside of the fonts folder, and caused some other preview handlers to not load at all. The new method should handle everything. Another bug prevented shortcuts to virtual locations from being followed, and a few other minor touchups were made.
Beyond the fixes, some new features have been added too: Previously there was no quick option to just get a list the only the files selected or only the folders selected; you could either get a combined list, or need checkboxes and get those. FilesSelected, FilesSelectedFull, FoldersSelected, and FoldersSelectedFull are the additions. You can specify a manual width for tiles (the default is still automatic width), the view mode List gets rid of ridiculously sized labels, the Back/Forward options can now appear in FilesOnly mode's context menu (or if they had been in the Control Box, and that was autohidden, they'll also appear in the context menu now), you can expand the current folder in the Dropdown in all modes now-- the DropdownExpandChildren option in the main Properties window, no longer a UserOption. Finally there's now option to prevent the Details and/or Preview Panes from being resized, and if you're in FoldersOnly mode, there's an option to include shortcuts to folders.

Lastly, there's a new Demo! I made a Demo, which also requires ucShellTree to be present (if you can load the old DemoEx, this will load, it uses the same location references), that illustrates making an advanced Open dialog out of the controls:

The new demo has the incidental benefit of demonstrating a new feature... since it's an open dialog for images, we don't want folders going in the open selection or combo box, but do want them visible and selectable for navigation. So the demo code utilizes the new FilesSelected option for what names to put in the box, and FilesSelectedFull for the full path list for the Open button. If folders are part of the selection, they're simply not included in the list, but you can still double click them for navigation.
Demo Note: The DemoOpenDlg demo here illustrates the need to set NoLabelWrap to False if you're going to use any of the Icon views (Med/Lg/XL icons + Thumbnails). It's False by default I forget why I turned it on, but I'm not going to update the whole DL just for that.

Here's the full changelog:


```
'New in v9.1 (Released 08 Jan 2021)
'
'-There was SelectedFiles and SelectedFilesNames, and these returned both files
' and folders. There was FilesChecked() and FoldersChecked(), but these obviously
' only applied to checkmarks. Now theres FilesSelected, FilesSelectedFull,
' FoldersSelected, and FoldersSelectedFull (item names and their full paths,
' respectively). These return lists of either only the selected folders, or only
' the selected files.
'
'-You can now specify a fixed, manual tile width for Tile View with the TileWidth
' option. The specified value will be multiplied by the DPI scale (m_ScaleX). Set
' to 0 (the default) to keep using automatic width.
'
'-When the View Mode is set to List, all of the item labels are set to the width
' of the largest one in the ListView. This leads to fantastically wide labels
' because a single filename has dozens of characters in it. There's now the
' ListModeMaxWidth option, to limit this to a more rational value. The default
' is 200, and you can set it to 0 to disable this option and use the old behavior.
'
'-Added NavShowOnFilesOnlyCtxMenu, which will show Back/Forward as menu items in
' the View Menu when it comes up as a right-click when Files Only Mode is set.
'
'-The Navigation Buttons will now also show up on the background View Menu when
' they're normally in the control box, but the control box is invisible, like
' is done with the Bookmarks menu.
'
'-A couple versions ago, a feature was added to add the children of the folder
' selected in the Directory Dropdown. This was done by default only in the
' Directory Only and Directory Only with Controls modes, and changing it was a
' User Option (nExpandSelectedFolderInDropdown). This is now a standard property
' called DropdownExpandChildren. It retains the same options (DirOnly/DirOnlyCtl,
' Always, and Never) and same default (DirOnly/DirOnlyCtl).
' Currently, this is not support in High Performance Mode. Any folder loaded using
' the HPF loader won't expand.
'
'-Added options DetailsPaneNoResizing and PreviewPaneNoResizing. These lock the
' respective controls dimensions then disable the menu with the option to unload.
'
'-Added options FoldersOnlyIncludeLinks[HPF]. If true, includes links whose targets
' are folders in folders only mode. Enabled by default in normal mode, disabled by
' default in High Performance Mode.
' This option is ignored if FollowLinks is not True.
' Shortcuts to zip files will only be displayed if BrowseZip is True.
'
'-(Bug fix) Shortcuts were flagged as zip files. Not sure of the implications, but
'           it probably caused a problem somewhere...
'
'-(Bug fix) Shortcuts to virtual locations were resolved to their display names
'           instead of parsing name or nothing, so never fell back to the pidl
'           when double clicking on one to follow. It will now try to get the
'           pidl first, and only fall back to strings if that fails. Virtual
'           locations work now.
'
'-(Bug fix) In LVLoadFolder, var li was declared in an If block then reused; the
'           right (or, here, wrong) set of config options would result in hitting
'           an 'undefined variable' error.
'
'-(Bug fix) In the View Menu for right-clicking the background in the file list,
'           the Bookmarks submenu should appear if enabled but not visible, but the
'           check for visibility looked at whether the control box was enabled, and
'           not when it was actually shown, so depending on the circumstances, the
'           Bookmarks menu would be missing when it should have been included.
'
'-(Bug fix) Back in V8.2 I added the ability to preview fonts in the font folder.
'           Now, I noticed this somehow broke the ability to preview fonts outside
'           of the fonts folder, as well as some other types of preview handlers. I
'           can't determine exactly why some previewers break and others don't, but
'           the method used now seems to cover all scenarios.
```

----------


## fafalone

*Project Update: Version 9.2 (February 9th, 2021)*
Severe bug: I'm very sorry for a bug in the previous version that showed an incorrect menu when right clicking a file (the shell background menu where most items don't work, I was playing around with it and I guess forgot to disable it). A lot of features for the next version were ready to go, so I went ahead and released a new version instead of just a quick fix.

This new version has a bunch of new features: There's an option to display Alternate Data Streams for NTFS volumes. The most common is the Zone.Identifier file, which is what Windows reads to warn you about files downloaded from the internet. Drag and drop works much better. You can now drop on all drop targets, such as dropping on an exe to open the dropped file with that app. The Details Pane and Search Box now use the same font as the rest of the control (new option, you can set it False to keep using a separate font). Added SelectedFilesCount, FilesSelectedCount, and FoldersSelectedCount methods to easily retrieve counts of those items.

There's also several other less severe bug fixes. 



```
'New in v9.2 (Released 09 Feb 2021)
'
'-NOTE: You may be noticing a pause after double clicking a folder with thousands
'       of items before the 'Listing items' status message starts appearing; this
'       isn't from loading the folder, it's from generating the info tip, which is
'       triggered by mousing over the folder. You can set the info tip mode to
'       LabelTipOnly or Disabled to eliminate this delay.
'
'-NOTE: As a reminder, the high performance loader has a significant difference
'       between IDE load times and the compiled exe. Refer to the following test:
'        Items      IDE          Compiled    (times = mean of 3 trials, dev<100ms)
'         7.5k      1510ms         610ms
'         20k       4540ms        2387ms
'         57k      15790ms        9780ms
'       The User Option bShowLoadTimeAsStatus has been added to display the load
'       times and whether the standard loader or high performance loader was used,
'       in the Status Bar after directory loads.
'
'
'-Added the ability to display NTFS Alternative Data Streams with the ShowAltStreams
' option. These are hidden streams attached to files; the system uses these to
' create Security Zone Identifiers that display a warning about opening internet
' downloads. But other apps can create additional streams containing any data of
' any size. These files can't be handled by Explorer, so it's display only, the
' context menu can't take actions on them.
'
'-Improved drag and drop functionality. You can now drop on any files that support
' a drop, such as dropping on a .exe to open with, or on a shortcut to move to the
' target folder. The program now makes a better guess at what the default action
' will be for a left button drop: There's no surefire way to know what Explorer
' will do, since the methods it uses are not public, so previous versions might
' say Move To ... only to copy it when you drop, or say Copy To and then move it.
' It should now be correct the vast majority of the time; if it's going to a
' different root (i.e. a different drive, or drive to network, or network share
' to different network share on the same server), or being dropped on a zip file,
' it's flagged as a Copy. Only if it's going to a regular folder on the same drive
' is it flagged as a Move.
' Also checked more deeply than just a folder attribute. This eliminates showing
' the Control Panel and some others as a drop target, but a few that remain and
' for some reason return valid drop target interfaces, but aren't actually drop
' targets, like This PC, are still an issue.
'
'-New option: DetailsPaneUseControlFont. Up until now, the Details Pane has used
' the system default caption font instead of the same font as the rest of the
' control, whatever that may be set to. It will now by default use the same font
' as the rest of the control, and you can set this option to False to go back to
' using the caption font.
'
'-High performance mode now displays the shortcut overlay. This incurred no
' performance penalty, but supporting the Share icon (or custom overlays) would,
' so that will remain unsupported in this mode.
'
'-Searching within a set of search results is not currently supported, but the
' search box stayed enabled and if let you execute a search that would always
' return no results. To end the confusion and make it clear, the Search Box, and
' the menu option to bring up the Search Popup, are now disabled when a Search
' Results folder is being displayed.
'
'-The Search Box in the Control Box now uses the main font that the buttons and
' ListView use.
'
'-Added SelectedFilesCount, FilesSelectedCount, and FoldersSelectedCount methods
' to easily retrieve counts of those items. It saves having to calculate from the
' actual lists, since there's a floor of 1 entry, and if that's the only item,
' then you need to further check whether it's empty or not. These provide that
' checking for you.
' Reminder: SelectedFiles[Paths,Items] includes both files and folders; I didn't
'           want to break existing code by renaming that when I introduced items
'           to provide separate lists for files and folders.
'
'-(Bug fix) The new high performance mode doesn't load even the default columns
'           unless used, so if a folder wasn't displaying the 'Type' column, the
'           type wasn't set, which meant it wasn't displayed in the Details Pane
'           for that item.
'
'-(Bug fix) The ListModeMaxWidth option introduced last version was not being
'           applied in the High Performance loader.
'
'-(Bug fix) In the Column Select ListView, when Advanced Mode was enabled, the
'           'Send to top' command set the system name column to empty.
'
'-(Bug fix) When creating a new control in the IDE, if you set the mode to Dir
'           Only/Drives Only[+Ctls], you couldn't make the control height smaller
'           than the Dir+Files limit until you closed and re-opened the form.
'
'-(Bug fix) A debug test option was accidentally left enabled that would show the
'           shell background menu when right clicking a file instead of the file
'           context menu.
'
'-(Demo) Bug fix: In the DemoOpenDlg demo, the Open button would display the last
'                 set of selected files after the selection was cleared. It's
'                 important to note this was *not* a bug with the control, just
'                 with the demo not updating the var on frmOpen unless at least
'                 one item was selected.
'
'-(Code) The drag and drop labels that pop up over the cursor were still hard
'        coded in English. They're now constants in the main strings section if
'        you needed to localize them.
```

Note: Dropping files in a media device (e.g. cell phone, camera) may cause a freeze if running from the IDE, but it works normally without issue in the compiled exe. I'll be looking into this but didn't want to hold up the release on account of it since the it's not an issue for a compiled program.

Note: I've modified the ucShellTree_ItemSelect event, so in the DemoEx and DemoOpenDlg projects, and potentially your own projects, if you still have an older version of ucShellTree, a message will pop up telling you it doesn't match. Just cut out all the code between Private Sub ucShellTree_ItemSelect(...) and End Sub, then delete those two lines, and select it from the dropdown again. Then paste your code back; you don't need to modify it, parameters were added but none were removed.

----------


## fafalone

**New update again on Feb. 11**

*Project Updated to v9.2 R3*
Quick fix: When Group View was enabled and the current View Mode was something besides Medium/Large/XL Icons, or Thumbnails, if you then switched into one of those modes, no items would appear in the list, until you refreshed the current location or opened a new one. This bug seems to have been present since the new Med/XL Icon options were added back in v7.4 so I'm not making a new post for it since it doesn't seem to be effecting anyone, but did want to get the update out immediately.

A couple new features and a second minor fix added as well, see log.


*Project Updates in Version 9.2 R2*
Quick fix 1: Switching to Thumbnails View in High Performance mode stopped the enumeration if it came across a file with an overlay (shortcut/share). This only happened when switching; if you refreshed or loaded a new location it worked fine.

Quick fix 2: In Directory Only and DirOnly+Controls modes, if DropdownExpandChildren was enabled, the edit box of the combo was stuck and wouldn't change. This may have affected all 9.x versions.

Update: Also the control in development mode now always appears in the correct font. Previously it would only show a non-default font when you first changed the font property. (Runtime would apply the font you selected, just not the Form Editor/Design Mode)




```
'New in v9.2 R3 (Released 11 Feb 2021)
'
'-Set the default for Multiselect to be True.
'
'-After a search, there's an option to repeat in 'Custom...'. This can select
' multiple folders, and was just displayed as 'Search Results in Custom'. Now,
' it takes the title of the folder(s) you chose, listing up to (a default) of
' 3, e.g. 'Search Results in Folder1, Folder2, Folder3, ...', or if you just
' selected a single folder, 'Search Results in Folder1'. You can change the
' default of up to 3 names with the nMaxFoldersInCustomSearchLabel User Option.
'
'-The 'Search Again In...' footer bar (if enabled) now also appears when you
' navigate back to a previous set of search results.
'
'-(Bug fix) When Group Mode is turned on from a view besides Sm/Md/Lg Icon or
'           Thumbnails, the first time switching to one of those view modes
'           results in no items being displayed until the view is refreshed
'           or a new location is loaded.
'
'-(Bug fix) Clicking the StatusBar while in a folder with hyperlinks as a column
'           could trigger a link click.
'
'-(Bug fix) Doing a 2nd search in a folder with the same name as a previous
'           search only created a 2nd label, e.g. Folder <2>, and if you then
'           conducted a 3rd search also in 'Folder' (even if in a different
'           parent), it then replaced Folder <2> instead of being Folder <3>.
'
'New in v9.2 R2 (Released 10 Feb 2021)
'
'-When selecting a new font, it would show in development mode when selected, but
' after that whenever the form was reloaded in development mode the control would
' appear with the default font (even though the one you selected was applied at
' runtime). The control in development mode now always reflects the correct font.
'
'-(Bug fix) Switching to Thumbnails View in High Performance mode would stop the
'           enumeration when it hit a file with an overlay.
'
'-(Bug fix) If DropdownExpandChildren was enabled and the control was in Dir Only
'           or Dir Only + Ctl mode, the current selection wouldn't change.
```

----------


## THN1234

Hello fafalone,

thank you very much for ucShellBrowse.

I am only starting to use it very recently, please forgive the stupid noob question. When I call ucShellBrowse1.BrowserPath with a non-existend path, it seems that I get into the SimpleDialog() function, which itself calls TaskDialog (declared into comctl32.dll). I am on W10 32 Bit and it seems that my comctl32.dll does not have such an entry point. I checked for comctl32.dll from various other windows versions (XP, Vista, Win8...) but couldn't find any comctl32.dll with such an entry point.

Could you have a look?

Tx,

THN

----------


## Steve Grant

Entry point errors such as this are almost always caused by not having a Common Controls 6.0.0 manifest for the IDE and, when compiled, for the exe.

Here is a very simple manifest that you can put beside your VB6.exe file in C:\Program Files (x86)\Microsoft Visual Studio\VB98. Copy this into notepad and then save into the path mentioned as VB6.exe.Manifest



```
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity type="win32" processorArchitecture="*" version="6.0.0.0" name="mash"/>
<description>Enter your Description Here</description>
<dependency>
   <dependentAssembly>
      <assemblyIdentity
           type="win32"
           name="Microsoft.Windows.Common-Controls" version="6.0.0.0"
           language="*"
           processorArchitecture="*"
         publicKeyToken="6595b64144ccf1df"
      />
   </dependentAssembly>
</dependency>
</assembly>
```

----------


## THN1234

I apologize but your suggested solution does not work.
I have put the recommended manifest in
C:\Program Files\Microsoft Visual Studio\VB98
and also in
C:\Windows\System32
but still get the same error from within the IDE.

The compiled exe just ends w/o giving any output or error.

This is info about the comctl in my W10:


```
File Type: WINDOWS EXECUTABLE

File Version Information:
  File Version:                  5.82.19041.488
  Product Version:               10.0.19041.488
  File Type:                     0x00000002 (Dynamic-link library)
  File Subtype:                  0x00000000
  File Flags Mask:               0x0000003F
  File Flags:                    0x00000000
  String File Information:       1033 (Englisch (Vereinigte Staaten))
    CompanyName:                 Microsoft Corporation
    FileDescription:             Common Controls Library
    FileVersion:                 5.82 (WinBuild.160101.0800)
    InternalName:                COMCTL32
    LegalCopyright:               Microsoft Corporation. All rights reserved.
    OriginalFilename:            COMCTL32.DLL
    ProductName:                 Microsoft Windows Operating System
    ProductVersion:              10.0.19041.488

File Header:
  Machine:                       0x014C (Intel x86)
  Number of Sections:            5
  Time Date Stamp:               0x093B7A4C (28.11.1974 18:47:56)
  Pointer to Symbol Table:       0x00000000
  Number of Symbols:             0
  Size of Optional Header:       0x00E0 (224)
  Characteristics:               0x2102
    File is executable
    32 bit word machine
    File is a DLL
```

----------


## Steve Grant

Hi just seen your message but I am very short of time. Do the following, if this doesn't work you will have to zip up your entire code and post it for fafalone to look at. 

In declaration section of module or form.


```
Private Declare Sub InitCommonControls Lib "comctl32.dll" ()
PRivate Declare Function IsUserAnAdmin Lib "shell32" () As Boolean
```

In Sub Main or form initialise if you do not have a module.


```
IsUserAnAdmin
InitCommonControls
```

----------


## fafalone

There's some Windows setting on some versions that prevents the recognition of an external manifest. 

But that's really an oversight, the control is designed to provide basic function without the manifest... all of the uses of it are the same, so for an immediate fix in the SimpleDialog function, substitute a regular msgbox instead:


```
If IsComCtl6 Then
    Call TaskDialog(hWndOwner, hinst, pszTitle, pszMain, pszContent, dwBtn, dwIcon, pnButton)
Else
    SimpleDialog = MsgBox(iif(sMainText <> "", sMainText & vbCrLf & vbCrLf & sMessage, sMessage), vbOKOnly, sTitle)
    Exit Function
End If
```

Of course it's highly advised, and the control (and your app) will look much better and have all functions available, if you go ahead and add a manifest, but it's not strictly required.

You can also add a .RES file via Project->Add File, like the resDemo.res included for the demos, with a manifest.

(This is also fixed in the new version below)

----------


## fafalone

*Project Update - Version 9.3 Released*

This new update contains a large number of both new features and bug fixes, be sure to read the changelog to get everything. The most interesting new features: Custom Icon mode. You can now supply custom icons easily for each file; see the changelog below for detailed instructions. It's also now possible to set the ListView and ComboBox fonts independently from the rest of the control. You can also now use the CompareStringEx API to specify your own sorting locale and options, instead of always using the system default.



```
'-----------------------------Using Custom Icon Mode------------------------------
'Version 9.3 introduced an option to supply custom icons for each file.
'This is the SB_VIEW_CUSTOM member of the View Modes.
'
'The CustomIconsEnabled option sets whether this mode appears in the View Menu.
'You can of course set the mode to SB_VIEW_CUSTOM in your control Properties or
'though code and not have this or any option to switch view modes. If it is in
'the menu, it uses the caption from CustomIconsCaption.
'
'Set the size the custom icons will be in the CustomIconsSize property. This value
'will be multiplied by the DPI zoom factor, the final value will be reported when
'the control asks for the icons.
'
'Next, when the control needs an image (which could be during the folder load, or
'later when it's scrolled into view, depending on mode), it raises the event
'QueryCustomIcon. This event supplies a number of details about the file (this
'includes a reference to the pidl, it's not a copy so don't free it), and a value
'indicating the size the control is using, which is the value from CustomIconsSize
'multiplied by the DPI zoom. The next two params are what you set to a handle for
'your image. You only need to specify either an HBITMAP or an HICON, not both, if
'both are set it uses the HICON. The last argument indicates whether to free the
'image with DestroyIcon/DeleteObject after it's added.
'
'Finally, if a file with an overlay, such as a link, is encountered, the event
'QueryCustomIconOverlay is raised. Do not set a return value to use the system
'overlay for that index, set it to 0 to not use one, or supply your own, again as
'either an HBITMAP or HICON with the size specified by the cxy argument.
'
'NOTE: This may be unstable in the IDE, but works fine when compiled.
'---------------------------------------------------------------------------------
'
'------------------------------------CHANGELOG------------------------------------
'
'New in v9.3 (Released 04 Mar 2021)
'
'-If there's a blank BrowserPath value and a Custom Root set, the control will
' now open to (if not blank or previous location) the root, rather than App.Path.
'
'-BrowserPath now also supports using Environment Variables like %windir% or
' %ProgramFiles% as startup paths.
'
'-Previously, Environmental Variables were only supported if the path was only a
' single var, such as %WINDIR%. %WINDIR%\Fonts wasn't supported. The control now
' uses the ExpandEnvironmentStringsW API to expand all the variables within a
' path, so now you would have that load C:\Windows\Fonts, or even use a 2nd var,
' like %ProgramFiles%\MyApp\%USERNAME% loads C:\Program Files (x86)\MyApp\Name.
'
'-Added an easier route to set the font of the ListView independently. Normally,
' the main UserControl Font property is applied to everything. Now, there's two
' new Public Sub methods:
'     ListViewSetFontOLE - Supply a StdFont object (the VB standard .Font for
'                          controls). nApplyScaling sets whether to apply a DPI
'                          based scale like is applied when setting the main UC
'                          Font property; 0=Do not apply, 1=Apply if the option
'                          FontScaleForDPI is True, 2=Always apply. Also includes
'                          an option to specify a different font for the header.
'
'   ListViewSetFontByHandle - If you have an HFONT handle for a font, this lets
'                             you apply it directly. You can optionally specify a
'                             different font for the column header.
'
'-Added the same as above for the Directory Dropdown, ComboSetFontByHandle and
' ComboSetFontOLE, with the latter having the same nApplyScaling argument.
'
'-The Column Select ListView now inherits the same font as the main ListView by
' default (and if you've set them independently with the new option above it will
' inherit those instead); set via new User Option bColLVInheritFont
'
'-For sorting strings in the file list (e.g. File name), the control has used the
' StrCmpLogicalW API, which is the same API that Explorer uses. This applies the
' current system locale and the default options. There's now a public method named
' SetAdvancedStringSort that allows you to use the CompareStringEx API instead,
' allowing you to specify your own locale and options set. Note: No options are
' specified by default, so leaving that parameter blank is not recommended. The
' locale name can be left at its default, which applies LOCALE_NAME_INVARIANT.
'
'-The control has had an option to set a custom ImageList, but that wasn't really
' useful without a way to link it to individual files. There's now a new view mode
' called SB_VIEW_CUSTOM. See the 'Using Custom Icon Mode' section.
'
'-The DetailsPaneNoResizing option would leave the DetailsPaneHeightLocked option
' set to True when it was set to False (allow resize), which gave the impression
' that resizing was still not allowed unless the user figured out to right click
' then unlock the height. To make things clearer, setting this option to False,
' i.e. resizing allowed, will now also unlock the height until and unless that
' option is set back to False.
'
'-Made the UserControl ScaleWidth and ScaleHeight available as Property Gets, but
' these are read only, setting them caused problems.
'
'-Windows was doing something really funky after updating the properties in some
' instances: It copied the file to a new .tmp file, created another new temp file,
' deleted the original, renamed 1 tmp file, and deleted the other.
' This caused a problem if you were using a filter to only show certain files.
' The original was removed from the list upon deletion, then the new .tmp file
' didn't match the filter so wasn't added, making the file simply disappear until
' the folder was refreshed.
' To address this, the rename handler responding to SHCNE_RENAMEITEM checks both
' names against the filter, and if the old name didn't match the filter, but the
' new name does, it now processes the newly renamed file as a file creation, sent
' though LVAddEntry.
' Additionally, if an item is renamed and no longer matches the filter, it will
' now be removed.
' These options are controlled by the new UserOptions bRemoveNewFilteredItem and
' bInsertNewFilterMatches, which are True (enabled) by default.
'
'-The control now supports switching between all types during runtime; previously
' only switching between FilesOnly and DirAndFiles worked well, with the other
' combinations being unsupported and having various bugs.
'
'-BrowserPathItem now has a Let method too, that redirects to BrowserOpenItem.
'
'-(Bug fix) The BrowserPath would keep getting reset to App.Path if blank.
'
'-(Bug fix) In the Details Pane, if you started to edit a property, then hit the
'           cancel button, if you again started to edit the same property, it
'           would not trigger the Save/Cancel buttons to appear, you'd have to
'           edit a different property.
'
'-(Bug fix) In the Details Pane, if you edited a formatted number, then hit the
'           cancel button before saving, when you went to edit that property
'           again, it would show the full formatted string rather than just the
'           number that you need to edit, which would obviously then cause an
'           error if you attempted to save the non-numerical value.
'
'-(Bug fix) In the Details Pane, most of the time when you started editing a text
'           field, the arrow keys would move keyboard focus off to elsewhere.
'           Focus is now properly set so the arrow keys let you move around in
'           the box.
'
'-(Bug fix) The Search Box also now supports using the arrow keys most of the
'           time. A few circumstances you might need to click away then back to
'           get them working.
'
'-(Bug fix) The height of the StatusBar was factored into the Detail Pane min
'           height whether it was visible or not, resulting in a larger height
'           when the StatusBar was disabled.
'
'-(Bug fix) Some error messages were being displayed with a TaskDialog without
'           checking if ComCtl6 was available, leading to a 'Can't find entry
'           point' error.
'
'-(Bug fix) Menu tips for View Menu items had stopped working when accessed from
'           the View button.
'
'-(Bug fix) If the Control Type was DirOnly+Controls, changing the Navigation
'           Button type would reposition things completely wrong.
'
'-(Bug fix) In Drives Only mode, the initial path was incorrectly reported as
'           the configured startup path (App.Path by default). Also, not all
'           path related variables were set correctly since it was calling
'           LVLoadFolder with no ListView present; there's now a special handler
'           for this mode that skips that unneccessary routine.
'
'-(Bug fix) With a larger font size, the Directory Dropdown became larger in
'           height, and could overshoot the ListView and wind up partially on
'           top of it. Meanwhile, the Search Box stayed the height it was for a
'           default font size of 10, meaning letters would get cut off. The
'           ListView top and Search Box height now accomodate larger fonts.
'           ListControlBox buttons have their font point size limited to 10
'           because of physical size limits can change with new User Option
'           nLimitPointSizeForButtons. Additionally, ListControlBox buttons have
'           their height adjusted to match the combobox.
'
'-(Bug fix) When Group View is enabled, and the View Mode is set to Small Icon,
'           any groups with file names that run into the next column result in
'           items disappearing and sometimes, or sometimes not, reappearing with
'           mouse overs. This effects other API-based ListViews with Group View
'           and SmallIcon view as well. There's a User Option enabled by default,
'           bEnableFixForGVSMICON, that will fix the width of the columns that
'           are formed, then manually limit label lengths to prevent this bug.
'           Renaming still works normally (it will display the full name when
'           you begin the label edit), and names are restored when switching
'           to another view. I'm on the lookout for a better fix.
'           This fix is not currently implemented for High Performance Mode.
```

----------


## THN1234

Hello fafalone

thanks for your help.

Firstly, the two declares suggested by Steve do not solve the problem, behaviour (only when supplied path is non-existent) is still the same.

For your suggestion, indeed IsComCtl6 is False in my case (because tDVI.dwMajor is only 5) and hence triggers the standard MsgBox, which of course works OK.

So problem lies in my comctl32 beeing too low / too old? Strange this is since I'm on the latest W10 Pro 20H2 32 bit and a little puzzled. Anyway, I included the demo.res from your v9.3 in my project and now it also works OK in all cases.

Thank you again.

Best,

THN

----------


## fafalone

I'd assume Windows is not recognizing external manifests. Glad the resource file is working, you can always use something like LaVolpe's Manifest Creator to make new resource files or insert a manifest into an existing resource if you had one in another project.

If you wanted it enabled in the IDE too, to modify the vb6 exe you'd use something like ResourceHacker; open vb6.exe -> Action -> Add from script template -> Manifest -> Add Resource -> Paste your manifest instead or at least remove the compatibility section and DPI aware section (vb6 looks funky with that) -> Action -> Compile -> File -> Save
Here's the one I use in my VB6 exe:


```
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
   version="1.0.0.0"
   processorArchitecture="X86"
   name="Microsoft.VB6.VBnetStyles"
   type="win32"
/>
<description>VBnet Manifest for VB6 IDE</description>
<dependency>
   <dependentAssembly>
     <assemblyIdentity
       type="win32"
       name="Microsoft.Windows.Common-Controls"
       version="6.0.0.0"
       processorArchitecture="X86"
       publicKeyToken="6595b64144ccf1df"
       language="*"
     />
   </dependentAssembly>
</dependency>
</assembly>
```

Common Controls 6.0 was introduced with Windows Vista so you have the current version... it just needs to be enabled using a manifest, otherwise for legacy compatibility with older apps it only loads 5.0.

----------


## fafalone

*Project Updated to Version 9.3 Revision 2:* Critical Bug Fix
Going back to the startup folder (if not blank or last path) produced an error that the path could not be loaded and graphical/functional failures in the currently displayed path. This was due to the code change to unstick App.Path in the Properties Window BrowserPath item, for starting in a given path (app path if blank).

Also provided fixes for the Search Box being drawn too tall if a very small font was being used in the control, and System Names disappearing from Advanced Mode in the Column Select popup.
Updated the Search Popup to put the search terms box, if being displayed, at the bottom with enough space instead of crammed into the top right and overlapping other controls if a large font was being used, and applied that font since it hadn't been.



```
'New in v9.3 Revision 2 (Released 11 Mar 2021)
'
'-Adjusted the Search Popup; now if there's a box to enter your query, it's placed
' on the bottom after having made extra space, instead of cramming it in at the
' top, which would overlap the controls if the font size was bigger than default;
' the size of the font is now taken into account as well.
' (Bug) It was sized for main font but didn't use the main font until now.
'
'-When using Group View to group by Type, the header now includes the default icon
' for that type. This can be toggled on/off (on by default) with new UserOption
' bGroupViewUseIconsForType.
'
'-(Bug fix) When the Column Select ListView was in Advanced Mode, moving an item
'           up, down, or to the top, via the UpDown buttons or the menu option
'           caused the System Name to be cleared.
'
'-(Bug fix) Using a font much smaller than defaults would result in the Search Box
'           being sized *too big* and over shooting the draw area.
'
'-(Bug fix) If startup went to a regular path, you couldn't go all the way to the
'           startup path going Back in History. Trying to do so produced an error
'           and broke display of the current location.
```

Sorry guys hadn't considered how the history subsystem might have been effected.

----------


## fafalone

*Project Update: Version 9.4*
(Note: 9.3 R3 was just released a couple days ago and contained critical updates, so if you missed it make sure to grab 9.4 even if you don't care about this change to make sure you cover the bugs. Sorry, I've been working on this problem on and off since Version 1.0, finally solved it, and wanted to share immediately instead of whenever there's a big batch of changes)

It's finally nice to have an immediate update because something **GOOD** has occured: I have finally solved implementing IOleInPlaceActiveObject based keyboard focus control for UserControls with multiple subcontrols on them. Previously this technique was limited to single-control UserControls. What this means: Arrow keys work EVERYWHERE in the RIGHT WAY. As soon as you click a control, it doesn't matter what the last control was, the arrow keys will now work as they're supposed to, instead of being sent to the wrong control! (This was a problem far harder than you'd ever imagine).
That's the only change. Wanted it out immediately  :Smilie: 



```
'New in v9.4 (Released 13 Mar 2021)
'
'-I was finally able to figure out how to implement IOleInPlaceActiveObject-based
' keyboard focus control. The arrow keys work the first time in almost all
' circumstances now; the FilterBars on ListViews don't seem to support them? But
' besides that, they're working everywhere; ListView, Combo edit, search box, file
' properties in the Details Bar, all controls on the Column Select and Search Ops/
' Advanced Search popups.
```

----------


## wqweto

> I have finally solved implementing IOleInPlaceActiveObject based keyboard focus control for UserControls with multiple subcontrols on them. Previously this technique was limited to single-control UserControls.


Just curious what changes you made (would have peeked commit history if this project was on github) because current IPAO implementation looks faily standard IMO.

Was there some kind of a bug in the previous impl or is there a new revelation about Ax UI interactions you would like to share?

cheers,
</wqw>

----------


## fafalone

The issue was getting it to work when the UserControl has a whole bunch of subcontrols on it, mixed between VB controls and API controls. I've had it forever in the ShellTree control that goes along with this for example, because that's just the one control. But when it came to this UC, I was never able to find just the right way to arrange calls and focus changes to get it to work consistently. It's not a change to the baseline code, just how calls to it are structured to produce reliable results with this kind of control arrangement... in the past there would always be some combination of last click + current click that resulted in arrow keys/tab going to the wrong place.

If anyone thinks this is all trivial, they should have enlightened me earlier  :Big Grin: 

And now that I got that working... TABS:

*Project Update: Version 9.4 R2*
This continues the IOleInPlaceActiveObject keyboard functionality: After an epic 8-hour non-stop coding marathon, I've figured out how to fully implement tab functionality. There's a Tab Loop that goes through all elements; the ListView, ComboBox, Control Bar, Search Box, and then back to the host form. Then the Details Pane properties will loop through eachother, to the save buttons if present, then to the ListView. The Column Select and Search Popup each have their own tab loop for their elements. 



```
'New in v9.4 R2 (Released 13 Mar 2021)
'
'-Also was able to create a full Tab sequence: The start is the ListView. Then to
' the combo, up button, back button and fwd button (std btns only), view button,
' bookmark button, search box, then off the control.
' In the Details Pane, you can tab through each property, then to the save and the
' cancel buttons if present, then to the ListView to start that sequence.
' For the Column Select and Search Popup, their tab loops are mostly working, but
' they may still be a little buggy.
```

----------


## fafalone

*Project Update: Version 9.4 R3*

Ok let's try this one more time. The new IPAO setup had one major and one minor bug:

An item already selected couldn't be double-clicked due to an IPAO workaround. Found a solution without using that workaround at all, so now there's no special tricks it just handles click/double click/rename normally. Details Pane tabbing put you into an edit box you could wrongly type in instead of creating an alt control, and alt controls didn't have arrow key / tab focus... now they do. Also if you very first click was on the ListView on load, the arrow keys/tab didn't work until the 2nd click; this has been fixed.
Also, added Shift+Tab functionality to go backwards in the order, and put white backgrounds back in active detail edit boxes.



```
'New in v9.4 R3 (Released 13 Mar 2021)
'
'-Full shift+tab to go backwards in the tab order is now working for all items.
'
'-(Bug fix) A workaround for having rename by label edit work with the new IPAO
'           stuff resulted in not being able to double-click an item that was
'           already selected (you had to double-click it while another item was
'           selected). Turns out the workaround wasn't even needed by ensuring
'           the IPAO init fires for the UC before the LV on load.
'
'-(Bug fix) Tabbing through Details with alt controls (datetime or combo) would
'           put you in an typeable edit box, which is obviously wrong. The alt
'           controls and everything in now handled by the focus message, so not
'           only will the alt control pop up, it will have arrow key/tab focus,
'           and can then tab to the next one.
'
'-(Bug fix) On load, the very first click to the ListView didn't set IPAO focus
'           for arrows.
'
'-(Bug fix) The Detail item edit boxes weren't having their white backgrounds
'           set during editing.
```

----------


## fafalone

*Project Update: Version 9.4 R4*

I was setting up a thumbnail viewer based on this control and noticed a number of issues. If the monitor zoom was more than 100%, only a corner of image files would be included in the thumbnail. Between that and a few other adjustments, thumbnail view is much better now and displays the same thing across multiple scales. Included a new demo based of a thumbnail viewer: DemoThumbView- it's a completely locked down configuration that simply displays the thumbnails of a given directory. All panels are disabled, navigation and any option that would lead to it is disabled, the view mode is locked, etc, it's just a panel of thumbs.

Also added some minor things; option for whether groups are enabled, whether pasting is enabled, and removed sort from the menu if it's disabled.



```
'New in v9.4 R4 (Released 15 Mar 2021)
'
'-Made major improvements to thumbnail view. The previous method would, for image
' files, just show a chunk rather than a scaled down version. And sometimes lose
' transparency in .ICO files. All that varying depending on monitor zoom. I've
' redone things to take the best approach for each type, so it shows all extended
' thumbnails and image thumbnails, scaled properly, etc.
'
'-Added a new demo: A pure thumbnail viewer. All parts besides the view are hidden
' and disabled, all navigation is disabled, etc. DemoThumbView.
'
'-Added option for enabling the Group By.. submenu. It was previously controlled
' with LockNavigation.
'
'-Added option to disabling pasting (and remove it from the menu).
'
'-(Bug fix) The Back/Fwd buttons would appear in the background menu (in the
'           situations they normally would) event if LockNavigation was enabled.
'
'-(Bug fix) Sorting appeared in the View Menu even if it was disabled.
```

----------


## fafalone

*Project Update: Version 9.4 R5*

Just needed to clean up a few outstanding bugs. Thumbnail view labels overlapped if you used a larger font size, overlays (shortcut arrow, etc) would show up as black boxes in Icon/Thumbnail/Custom views once you navigated to a new directory (the first directory you switched to that view would be fine), fixed icons getting truncated in the Preview frame, Files Only mode had the dropdown space shown (it was blank, but added a big gap), and removed ghost click events where they fired from background clicks with no file selected. Also found a significant source of memory leakage; menu icons weren't freed.



```
'New in v9.4 R5 (March 16, 2021)
'
'-(Bug fix) Fixed a number of memory leaks.
'
'-(Bug fix) File click events would be raised with empty paths if none selected.
'
'-(Bug fix) If the ListView font size was larger, thumbnail view labels would
'           overlap the one under it since the manual spacing that mode uses did
'           not account for different sizes.
'
'-(Bug fix) In High Performance Mode, overlays (shortcuts, etc) would show as
'           black boxes when you navigated to a new directory in Med/L/XL Icon
'           View, Thumbnail View, and Custom View (if you switched to those views
'           the current directory would be fine).
'
'-(Bug fix) Fixed icon sizing for the preview frame. I'm aware that on Win10 it
'           may only be loading very small sizes; this effects thumbnail view
'           as well, but this will have to be investigated in the future.
'
'-(Bug fix) If your initial control type is Files Only, there was a gap at the top
'           where the dropdown would be if it was enabled.
```

----------


## yokesee

very good work everything works perfect,
even much faster than previous versions.

a few minor issues with ucShellTree

procedures does match


```
Private Sub ucShellTree1_ItemSelect(siItem As oleexp.IShellItem, sName As String, sFullPath As String, bFolder As Boolean, hItem As Long)
'If bStartup = False Then
    If bFolder Then
        'Previously we set by path, but this won't work with Win10 virtual devices like phones and cameras
        'ucShellTree had to be extensively modified to not navigate or set the selected ishellitem by just the path either
'        ucShellBrowse1.BrowserPath = sFullPath
         ucShellBrowse1.BrowserOpenItem siItem 'ucShellTree1.SelectedShellItem
    End If
'End If
End Sub
```

me use 2.5-R2


```
Private Sub ucShellTree1_ItemSelect(sName As String, sFullPath As String, bFolder As Boolean, hItem As Long)

End Sub
```


greetings very good job

----------


## fafalone

Sorry about that the next version I'm working on adds that argument. I've updated the download to remove it for now, or you can just delete the siItem argument and use the commented out way of changing the shell item (that's the only change):



```
Private Sub ucShellTree1_ItemSelect(sName As String, sFullPath As String, bFolder As Boolean, hItem As Long)
'If bStartup = False Then
    If bFolder Then
        'Previously we set by path, but this won't work with Win10 virtual devices like phones and cameras
        'ucShellTree had to be extensively modified to not navigate or set the selected ishellitem by just the path either
'        ucShellBrowse1.BrowserPath = sFullPath
         ucShellBrowse1.BrowserOpenItem ucShellTree1.SelectedShellItem
    End If
'End If
End Sub
```

----------


## fafalone

*Major Project Update: Version 9.5*
Originally, this was just going to be a quick fix... the black boxes for shortcut overlays still appeared in Med/L/XL icon view (when switching to a new folder in high perf mode).
HOWEVER... I went on a crazy coding binge making yet another update so soon worth it, by tackling some long standing problems:
-In the Details Pane, the properties boxes would routinely be placed such that property names got cut off, or it overlapped the type name, or there was an excessive gap at the bottom. The layout has been completely re-done from scratch. All columns are now the appropriate width for the properties they contain, and the next column starts where the previous one let off. There's no more issues with the file names overlapping, no more huge gaps at high DPI, everything is perfect.

-You can now set the font for the ListView/ComboBox, and Details Pane, separate from the main font for the rest of the control, right from the Properties Window with a font dialog. If you don't set the LV/CB or DT font, it defaults to the main control font, and stays synced to that until you specifically set it to something else.
-All the buttons/frames/textboxes now inherit the main control font, with the exception of being limited to size 9 for layout constraints.

-There's lists for Files and Folders (selected and checked, plus full paths for each), but now there's a combined list that contains both. Items(), ItemsFullParsing(), ItemCount, ItemsSelected(), ItemsSelectedFull(),' ItemsSelectedCount, ItemsChecked(), ItemsCheckedFull(), and ItemsCheckedCount.

A couple other small features and minor fixes round out the release. I've tried to test things thoroughly, so assuming nothing major pops up I intend to keep this version up for a while.




_Separate fonts and vastly improved Details Pane layout. Long properties like 'Contributing artists' had been particularly problematic._



```
'New in v9.5 (Released 18 Mar 2021)
'
'-Completely redid the Detail Pane property placement from scratch. Properties are
' no longer overlapping regardless of length, and are spaced according to their
' actual length so a column with short properties doesn't take up way more space
' then needed. The UserOption cxMaxProp specifies the maximum length of an edit
' box for a property, cxMinProp specifies the minimum.
' The file name/type display in the Details Pane also expands based on whether
' there's enough room to show any properties.
'
'-Made fonts independent of eachother. There's now FontFileControls that sets the
' ListView and ComboBox font, and FontDetails that sets the font for the Details
' Pane. Everything else is controlled by the original Font property.
' FontDetails and FontFileControls will default to the main font until you set them
' to something different.
' So if you're upgrading an existing project, no fonts will change, it will simply
' inherit the existing ones, with the exception that there's no more defaulting to
' a system font, so if you had DetailsPaneUseControlFont = False, it would now be
' the main font until you changed it.
'
'-Added Items(), ItemsFullParsing(), ItemCount, ItemsSelected(), ItemsSelectedFull(),
' ItemsSelectedCount, ItemsChecked(), ItemsCheckedFull(), and ItemsCheckedCount
' functions to retrieve a list of these for both files and folders instead of one
' or the other.
'
'-Added FilesCheckedCount and FoldersCheckedCount since there were counts for the
' full list and selected list, but not the checked list.
'
'-All controls on the Column Select and Search popups now inherit the main control
' font. Due to layout constraints, the size is limited to 9 points for now, so if
' the main font is larger, it will be reduced *only for these controls* (and the
' buttons in the Control Box); for the rest the full size is still used.
'
'-Added ControlBarHeight property. If you're using ListViewOffsetX to open a blank
' space for e.g. a ShellTree, it's helpful to know the current height of the
' control bar, since a larger font size will make it taller. (Get only).
' The ShellOpenDemo project shows this in use.
'
'-Final sizing wasn't applied when the control was first loaded into the IDE form
' designer; it now runs the full resize routine so it should better match the
' runtime appearance. Always check that; some things can't/won't be reflected at
' design time. Most notably, if it's view is Thumbnail View, that won't be applied
' until runtime, so the designer will show it in the last normal mode it was in.
'
'-(Bug fix) Changing the font during runtime resulted in the font on the Command
'           Buttons being 'stuck'... it wouldn't fonts again until the app
'           restarted, or if in the IDE, until the entire IDE restarted.
'
'-(Bug fix) If you set the Details Pane to not inherit the main font, the spacing
'           and sizing were incorrect (and illegible). However, that option has
'           now been removed since it can be set separately.
'
'-(Bug fix) The black box overlay bug was not actually fixed for MD/L/XL icon view.
```


*NEW!* I'm also now distributing ucShellBrowse and ucShellTree together as a compiled OCX, complete with SxS resources to create registration-free distributions.

[VB6] Shell Controls OCX

----------


## fafalone

*Project Update: Version 9.5 R1*
I have no idea how this was overlooked but for some reason tabbing had stopped working. Also before it stopped working, tabbing then shift-tabbing between a VB control and API control resulted in focus getting stuck.
Also a minor bug fix; after Tile View was selected, moving to a new folder added an extra line that duplicated the file name. Also added a DetailsPaneOffsetX property, to move that over the same way as the ListView, letting you have a ShellTree etc. go further down the side--- the DemoEx sample has been updated to use this, while DemoOpenDlg continues to only offset the ListView.





```
'New in v9.5 R1 (Released 22 Mar 2021)
'
'-Added DetailsOffsetX property, so that you can e.g. have a ShellTree that goes
' all the way down to the StatusBar without also having the Details Pane under it.
'
'-(Bug fix) Eliminated memory leaks from unfreed font handles.
'
'-(Bug fix) After Tiles View is set, moving to a new directory causes there to be
'           a 4th line that duplicates the file name.
'
'-(Bug fix) Tabbing had stopped working. Also, when they were working, focus would
'           get stuck if you tabbed backwards between a VB and API control.
```

----------


## fafalone

*Project Update: Version 9.5 Revision 2*
Sorry for yet another significant bug guys... the complexity is really getting out of hand for what I have time for  :Sick: 

The new focus system for arrows and tabs changed the way focus worked, such that if you clicked a button in the control bar (Up, View, etc) then clicked the Search Box or Combo edit box (if present and editable), enter keypresses went to the button, instead of the box, which made it impossible to search (unless you clicked another API control first, then went to search). I was able to find a workaround that fixed this without breaking the tab/arrow keys functionality.
Also made a major performance improvement for High Perf mode; for InfoTips on folders it won't search that folder for its contents, which could take a while for large folders. and it won't lookup link targets for those properties either; also InfoTipMode wasn't being changed during runtime. Finally, added Copy Names/Full Paths to the shell context menu.



```
'New in v9.5 R2 (Released 25 Mar 2021)
'
'-Added Context Menu items 'Copy names' and 'Copy full paths' to copy the selected
' items to the clipboard.
'
'-Substantial delays could result from mousing over certain items like a folder
' containing thousands of items while the InfoTip was generated, since the code
' was set to go deep to generate the best tip. Using slow tips is now disabled in
' High Perf Mode, as is looking up link targets and using their info. This doesn't
' effect most items; pictures, mp3s, etc, will still show metadata... as far as I
' can tell this only effects showing Size/Files/Folders in Folder infotips.
' You can toggle this setting with the User Option bLimitInfoTipsInHighPerfMode.
'
'-(Bug fix) Changes to InfoTipMode were not being applied during runtime.
'
'-(Bug fix) The new tab/arrow key system set the focus in such in way that if you
'           clicked on a button (View/Up/etc) then click on the Search Box or the
'           Dropdown edit box (if present and editable), the enter key went to the
'           last button pressed. I found a workaround to resolve that without the
'           tab/arrow keys breaking again.
```

----------


## MountainMan

ShellBrowseDemoEx compiles but will not run. It stops on line 533



```
ucShellTree1.OpenToItem siItem, False
```

 in Form1 with Run-time error 10: "The array is fixed or temporarily locked".

----------


## fafalone

Uncomment the bChanging check/toggle in ucShellBrowse1_DirectoryChanged and Form_Load... looks like I accidentally included the demo that was updated for the next ShellTree version, which eliminates the need for that.

Or just update the OpenToItem sub to the future version;


```
If bLoadDone = False Then Exit Sub
Dim lpFull As Long, sFull As String
si.GetDisplayName SIGDN_DESKTOPABSOLUTEPARSING, lpFull
sFull = LPWSTRtoStr(lpFull)
If (sFull <> "") Then
    If sFull = sSelectedItem Then Exit Sub
End If
bNavigating = True
bFlagBlockClkExp = False
pSetRedrawMode False
Hourglass True
lLoopTrack = 0
DebugAppend "OpenToItem " & sFull
If IsUSBDevice(sFull) Then
    DebugAppend "OpenToItem->Detected USB device, ensuring add..."
    Dim hrua As Long
    hrua = USBDeviceEnsureAdded(sFull)
    DebugAppend "OpenToItem->EnsureAdd result=" & hrua
End If
DebugAppend bExpandTarget
TVNavigate si, bExpandTarget, bSelectTarget
Hourglass False
pSetRedrawMode True
bNavigating = False
```

----------


## MountainMan

Okay. Next problem with ShellBrowseDemoEx

OutputDirList (which is Command3). If I have one or more items selected in the UCShellBrowse1 control then a listing is output to the Immediate windows so that is okay. However, if there is nothing selected in the control, when I click on this button I get an error message "Subscript Out of range" and execution halts at line 316



```
Set pArSel = ucShellBrowse1.SelectedItems
```

My guess is that there needs to be a check to ensure that at least one item is selected in the control before that line of code executes. I tried to insert UCShellBrowse1.SelectedItems.GetCount but that didn't work.

----------


## xiaoyao

.The cost of developing controls is too high. It is best to give him a separate module. It is convenient for other people to be quoted. First, it is necessary. Well, super programming ability. Most It is difficult to get repaired when you encounter different bugs. The more difficult problems are more difficult.

If a control needs three or five modules. Each module is marked with detailed functions and how to call the method.

VB 6 has been abandoned by Microsoft more than 20 years, I do not know how the development in other countries, how many people use?

----------


## fafalone

> Okay. Next problem with ShellBrowseDemoEx
> 
> OutputDirList (which is Command3). If I have one or more items selected in the UCShellBrowse1 control then a listing is output to the Immediate windows so that is okay. However, if there is nothing selected in the control, when I click on this button I get an error message "Subscript Out of range" and execution halts at line 316
> 
> 
> 
> ```
> Set pArSel = ucShellBrowse1.SelectedItems
> ```
> ...


Yeah it was just meant to display selected items.... ucShellBrowse.SetSelectedItemArray is the source of the error, and should have the following sanity check:


```
If cpidl Then
    Dim pdo As oleexp.IDataObject
    psfCur.GetUIObjectOf 0&, cpidl, apidl(0), IID_IDataObject, 0&, pdo
    If (pdo Is Nothing) = False Then
        oleexp.SHCreateShellItemArrayFromDataObject pdo, IID_IShellItemArray, siaSelected
    End If
End If
```

(it's encountering an undim'd apidl() )


I actually did add a counter, .ItemsSelectedCount, but that has a bug too, it doesn't differentiate between 0 and 1 because it's checking an array of paths and just reporting the UBound... it should be:


```
Public Function ItemsSelectedCount() As Long
If UBound(sSelectedFiles) = 0 Then
    If sSelectedFiles(0) = "" Then
        ItemsSelectedCount = 0
    Else
        ItemsSelectedCount = 1
    End If
Else
    ItemsSelectedCount = UBound(sSelectedFiles)
End If
End Function
```

The other counts all use a different method so are ok (you could e.g. check FilesSelectedCount+FolderSelectedCount which actually do do that check I missed here).

Apologies for more bugs, I'll have to update it tonight... I run through most common things in pre-release tests but it's just getting so complex that the few hours a week I have to work on it don't leave as much time to testing as needed.


@xiaoyao I'm not entirely sure what you're saying... this is just a personal fun project for me, I'm not spending any money developing this control. And there's pros/cons to splitting things up into different modules. It's great for a full project, but just for an individual control, I like having it as self-contained as possible.

----------


## MountainMan

No problem. All of us here appreciate the time and effort you put into this. We've all got day jobs (most anyway) so we understand limited time constraints. Thanks so much for developing these controls.

----------


## fafalone

Glad it's appreciated  :Big Grin: 

All those bugs and some others are now covered:


*Project Update: Version 9.6*
A number of small bug fixes make this release needed. Most critically, .SelectedFiles returned an error if nothing was selected. Also got in a couple small improvements; the focus issues are resolved even better now that the control box buttons are API created, custom shortcut overlays are loaded for Med/L/XL Icon and Thumbnail modes, and the View/Bookmark menus popup under the buttons (if that's where they're launched from) instead of whereever the mouse is.

Note on working with ucShellTree: That project has been updated such that there's no longer a need for a variable to track when a directory change is happening, so now all you need in the DirectoryChange event for ucShellBrowse is:


```
Private Sub ucShellBrowse1_DirectoryChanged(ByVal sFullPath As String, siItem As oleexp.IShellItem, pidlFQ As Long)
    ucShellTree1.OpenToItem siItem, False
End Sub
```

You'll want to grab the new version (2.6) of that before you run DemoEx or DemoOpenDlg in this download, as they've been updated to reflect this change and will error with an older version (and DemoEx accidentally had in the previous version, before 2.6 was released).



_If you've set up custom shortcut overlays, they're now loaded. If not, no worries, it defaults to the system one if not set._



```
'New in Version 9.6 (Released 03 Apr 2021)
'
'-Replaced VB CommandButtons in Control Box with API-created ones, to avoid any
' remaining focus issues. Will do the Columns and Search popups at some point.
'
'-The View Menu and Bookmark Menu now pop up under their respective buttons,
' instead of wherever the mouse cursor is, which might be way off if it opened
' from a keyboard press rather than click. The right-click on the ListView back
' will still of course open at that point.
'
'-If the system shortcut overlay has been changed, used that instead. Only
' currently supported in Med/L/XL icon and Thumbnail Views. Can be disabled with
' the bUseCustomShortcutOverlay User Option.
'
'-(Bug fix) In certain modes, overlays wouldn't load.
'
'-(Bug fix) Fallback images for when ComCtl6 wasn't present, and the non-themed
'           back button image, had mysteriously vanished.
'
'-(Bug fix) If the Back/Fwd button were normal buttons, if they weren't enabled
'           the tab cycle would get stuck
'
'-(Bug fix) If you used a very large font for the file controls, but not for the
'           main UserControl font, and the Search Box was not visible, the bottom
'           of the Up/View/Bookmark buttons could be truncated.
'
'-(Bug fix) Memory leaks in thumbnail generation.
'
'-(Bug fix) .SelectedItems would cause an error if no items were selected when
'           it was called.
'
'-(Bug fix) .ItemsSelectedCount return 0 for both 0 and 1 items, then was off by
'           one for more.
'
'-(Bug fix) If you started in Files Only mode, and changed to Dir+Files or Dir
'           Only + Ctls during runtime, in some circumstances the control box
'           height would be too small and cut things off.
```

----------


## yereverluvinuncleber

Ignoring xiaoyaiao' gibbersiht completely. You are doing a good job faf.

----------


## fafalone

*Project Update: Version 9.6 Revision 2*
*Major issue:* The ComboBox, when editing is enabled, would not display the full path when clicked, and in many circumstances could not be edited, and pressing enter would not open the path even if it could. This was related to focus issues from the IPAO update. Sorry this was not noticed for so long (how did no one notice this??). 
Also fixed a couple minor issues; View Menu status bar tips stopped working again, and when the Search Box was grayed out while displaying results, the tab cycle got stuck on it, and graphics glitches with the Thicker control border style.
One new feature: The Security Zone is now displayed in the status bar like in Explorer, set with new ShowSecurityZone option (default=True). The icon and text are loaded from Windows.

I forgot to add a description for the new ShowSecurityZone option, but there's already a bunch of DLs so I'm not going to re-update. It will read:
"Displays the icon and description of the Security Zone of the loaded folder in the Status Bar, e.g. 'Computer', 'Local intranet', etc."






```
'New in v9.6 R2 (Released 21 Apr 2021)
'
'-The StatusBar will now show the Security Zone of the current location, if
' enabled with the ShowSecurityZone option, complete with the icon. The text
' (and icon) are loaded from Windows, so don't need manual localization.
'
'-The StatusBar shows a size grip if the Control Border Style is SBCB_Thicker,
' which makes it resizable.
'
'-(Bug fix) If the Search Box was grayed out, it couldn't receive focus and the
'           tab sequence got stuck.
'
'-(Bug fix) The status bar menu tips for the View Menu managed to stop working
'           again.
'
'-(Bug fix) If the Control Border was Thicker, which enables resizing, the
'           control would visually glitch.
'
'-(Bug fix) The ComboBox would not display the full path when clicked, and often
'           couldn't be edited, among other problems with it.
```

----------


## fafalone

*Project Update: Version 9.6 Revision 3*
_Re-released with additional fixes and features as Version 9.7._


Spent a bunch of time testing R2... all good... release... and of course the next day I can't so much as glance at the control without finding another bug.  :Eek Boom:  Sorry guys. Pretty sure it's good now.

----------


## fafalone

*Project Update: Version 9.7*

(This version was pulled shortly after release for a major audit)

----------


## fafalone

*Major Project Update: Version 10.0*This version update has been adapted and finalized from 9.6 R3/9.7 with several more features/fixes.
Every time I went to save 9.6R3/9.7, a new bug popped up. After it happened a bunch of times, I pulled the project entirely. Then, I conducted a thorough review of every single Property and Public method in the control, fixing numerous additional bugs in the process.
With that and a few more features, it's time for a Major Version bump. 10.0 is the most tested version of ucShellBrowse ever.

See the log below for a full list of new features and the extensive bug fix list.



```
'New in v10.0 (Released 24 Apr 2021) - Also partially released as 9.6 R3/9.7.
'   Numerous features have been added throughout the day, and after I point I just
'   pulled the project entire.
'   After that, I took my time and conducted an extensive review of every Property
'   and public method, and resolved numerous additional bugs.
'   With that and some additional features, it's time for a Major Version change.
'
'
'-Changing the Combo Type to DropdownList then back had ComboCanEdit set to false
' which could be confusing if it had been true before. Added checks to obviate the
' need for doing that.
'
'-For the ComboType DropdownList, added arrow key functionality. Down arrow opens
' the dropdown, then arrow keys move up/down and enter navigates to the currently
' highlighted folder. For the standard Dropdown type, the control automatically
' opens the folder above/below with the arrow keys; there's no way to drop down
' the list like the other mode.
'
'-Changed the default SearchBoxWidth from 115 to 140.
'
'-Now loads a larger icon for the Security Zone icon when m_ScaleX > 1. Previously,
' the icon was always 16x16 and therefore *extremely* tiny.
'
'-Spaced out the columns in the Details Pane a bit and added the yDetailSpacer
' User Option to easily customization this column spacing factor. Minimum=18.
'
'-Autocomplete by default shows a popup results list now.
'
'-FilesOnly and FoldersOnly now refresh the view to apply the change.
'
'-The InfoTipsLimitForHPF property replaces the bLimitInfoTipsInHighPerfMode
' User Option. Don't use QITIPF_USESLOWTIP or QITIPF_LINKUSETARGET in HighPerf
' mode. Mainly affects showing Size/Files/Folders on folder tips.
'
'-(Bug fix) Unfortunately there were still outstanding issues with the ComboBox.
'           The tab loop didn't work at all in DropdownList mode. The tab cycle
'           would get stuck in the ListView.
'
'-(Bug fix) Changing ShowSecurityZone during runtime resulted in multiple bad
'           status panels being added.
'
'-(Bug fix) If the startup view was Md/L/XL Icon or Thumbnails, Custom Shortcut
'           Overlay will not load, and the system default is used.
'
'-(Bug fix) The Security Zone panel didn't autoresize; some zones may have been
'           truncated.
'
'-(Bug fix) The Search Box was having sizing issues. It's not tenable to have its
'           font be the main font and not the FileControls Font (like the Combo);
'           it would be cut off at high DPI even though it was explicitly set to
'           the correct text height. So it's now set to that font.
'
'-(Bug fix) VB .TextWidth/.TextHeight calls do not support Unicode, so some control
'           characters common to PropertyStore strings, which are hidden/are not
'           graphical characters, would be replaced by ?, and formatted strings
'           could have 4+ of these, throwing off the width calculation by including
'           4 characters that are never rendered.
'           This affected the spacing in the Details Pane, primarily because 4 of
'           them are included in strings formatted as a Date.
'
'-(Bug fix) The Bookmark, View, and History menus could not be displayed in
'           DirOnlyWithControls mode, due to the ListView being the parent. The
'           UserControl hWnd is used instead *only if the ListView is not present*
'           avoiding losing the status tips yet again...
'
'-(Bug fix) The 'Thicker' border on the ListView causes too many problems if it's
'           allowed to just resize the ListView, so resizing is blocked. On the
'           whole control, the 'Thicker' border allowed resizing the control to
'           smaller than cxMinUC/cyMinUC, including down to 0 which would then go
'           on to crash/freeze the control and app.
'
'-(Bug fix) While the font applied to controls was limited, some fonts are slightly
'           larger at the same size and this could cause the Column Filter checkbox,
'           Column OK/Cancel buttons to not be wide enough and cut text off.
'
'-(Bug fix) This same issue applied to the Search Options popup. Items were resized
'           to accomdate a larger font that's still within the control font size max.
'
'-(Bug fix) When some items have properties written, Windows does this ridiculous
'           thing with a long sequence of creating several temp files and a bunch of
'           renames. The Notify handler can't make sense of them, and tmp files wound
'           up being added, and the original file with the wrong icon and sometimes
'           type, even when absolutely everything to set those seemed correct.
'           It's now flagged to ignore everything until it gets the last message in
'           the sequence, or an update that indicates only UPDATEITEM fired.
'
'-(Bug fix) SpecialFoldersInBookmarks was not being applied to the Bookmarks menu
'           when it's part of the View Menu from a ListView background click.
'
'-(Bug fix) In HighPerformanceMode, attributes weren't stored with the item, breaking
'           among other things, dimming hidden file icons.
'
'-(Bug fix) Even when AllowRename was True, a label edit could not be initiated to
'           rename a file. In versions before that became the behavior, you could
'           start a label edit, but clicking on the edit box ended the labeledit,
'           and arrows did not work. There were a bunch of extra SetFocusAPI calls
'           causing this from before IPAO.
'
'-(Bug fix) When navigating back to the Custom Folder after adding it earlier, it
'           would not load the associated custom column set, instead loading it
'           just used the current column set.
'
'-(Bug fix) ShowAltDataStreams was not listing the size and was listing the type as
'           File folder instead of "(Alternate data stream)"
'
'-(Bug fix) The description for GroupCollapseGroups was the opposite of what was
'           actually done.
'
'-(Bug fix) The GroupStartCollapsed option, when group based on Name, only had the
'           first group collapsed instead of all of them.
'
'-(Bug fix) SetFocusOnFiles had stopped working at some point.
'
'-(Bug fix) The Properties window has a GroupMode entry visible, but the control
'           was not grouping by in on startup.
'           Note: Only SBGB_Name, SBGB_Size, SBGB_Type, and SBGB_DateModified are
'                 supported on startup.
'
'-(Bug fix) When using ItemFilterFolder, shortcuts to folders would always be added
'           in regular load mode regardless of whether they were a match or not.
'
'-(Bug fix) The New Folder menu item and InvokeNewFolder sub would both create a
'           new folder, but would either never initiate or immediately cancel the
'           label edit to start the rename operation. Further, InvokeNewFolder
'           would add it to the bottom of the list without scrolling to it.
```

See Also: The OCX version has been updated to use 10.0 as well.

[VB6] Shell Controls OCX
The OCX has its own demo:


Just for fun I duplicated that demo using the .ctl version of ucShellBrowse and ucShellTree instead-- it's the attachment of this post, not included in the main download. It works like DemoEx and DemoOpenDlg in referencing ..\ucShellBrowse.ctl and ..\..\ucShellTree\ucShellTree.ctl.

(Edit: New demo is now in the main zip)

----------


## fafalone

*Project Update: Version 10.0 R2*
A bug managed to slip through by only occuring in a highly specific situation  :Cry: 
If your startup mode is FilesOnly, but have enabled the SearchBox option, then during runtime switch to a mode with the Control Box visible, the Search Box does not show up along with the rest, even if you toggle it off and on.
Since this involves a completely broken main feature, had to release an update.

Added the DemoFileProc from above to the zip.



```
'New in v10.0 R2 (Released 28 Apr 2021)
'
'-(Bug fix) If the Search Box was enabled, but the mode set to FilesOnly, then you
'           changed to Dir+Files or other mode with the top bar, the Search Box
'           did not become visible along with everything else.
```

----------


## xiaoyao

ERRON ON:Optional dwACL As AUTOCOMPLETELISTOPTIONS = ACLO_FILESYSDIRS
PROJECT  :Big Grin: emoVBDir

----------


## xiaoyao

Reference=*\G{F9015E81-CAAC-45C0-94E8-42B7DA5D7557}#4.6#0#..\..\Windows\SysWow64\oleexp.tlb#OLEEXP - olelib With Modern Interfaces v4.6
Reference=*\G{F9015E81-CAAC-45C0-94E8-42B7DA5D7558}#4.7#0#C:\Windows\SysWow64\oleexp4.7.tlb#OLEEXP - Modern Shell Interfaces for VB6, v4.7

42B7DA5D7557
42B7DA5D7558
The V4.7 guid is different, which makes it completely useless. Every project has to be changed manually. Can I change it back to the previous GUID?

----------


## fafalone

I don't know why it's not just automatically referencing the new one but just uncheck the reference, close the references dialog, open it again, then browse to oleexp.tlb 4.7.

For the autocomplete error, the only reason you'd get that is if you were trying to use an older version of oleexp.tlb, you need to be using at least 4.61
In fact, ACLO_FILESYSDIRS was added in oleexp v3.5. If you're using a version that old, that would also explain why it's not automatically switching GUIDs either. (And since 3.x was oleexp3.tlb, are you using 2.x or 1.x??)

You're going to need to download the newest version of oleexp.tlb (4.7). There should only be *one* copy of oleexp.tlb on your system, in a common directory like Windows\SysWOW64. Once you've copied it there, open a project that references oleexp.tlb, goto 'references', uncheck any oleexp reference, click ok, open the dialog again, then click 'browse' and select the new version you installed.

Yes, you're going to need to do this for each project that references the tlb. Upgrading versions after 4.0 don't require this so you won't need to do it again in the future, but you're using 3.4 or earlier so it's too out of date to update automatically.

----------


## fafalone

*Project Update: Version 10.0 Revision 3*
The minimum control height for FilesOnly/Dir+Files was applied at runtime for other modes, creating a big empty space below the control, potentially on top of other objects on your form.
I swear I could bug test for a month straight 24/7, then still find something I missed a day later  :Blush: 



```
'New in v10.0 R3 (Released 29 Apr 2021)
'
'-(Bug fix) The minimum height for the control was being enforced, but was not
'           appropriate for DirOnly/DriveOnly/DirOnlyCtl, which left a big chunk
'           of blank space under the control that might cover up other objects on
'           your form.
```

----------


## yokesee

very good work as always
I have problems with Demoex projects, demothumbview
Oleexp 4.8 and in the codebank this 4.7
a greeting

----------


## fafalone

What's the exact problem? It really shouldn't matter which version the string describes, the GUID is the same. Worst case just remove and re-add the reference.

----------


## yokesee

I'm sorry forget to put the error.
This array is fixed or temporarily locked
in ucShellTree CreateCurrentMap()

in ReDim TVVisMap(0)


I do not have time to investigate more
a greeting

----------


## fafalone

Are you sure you have the latest version of ucShellTree (2.6)? And in the stock demo, or how did you modify it?

I recall fixing a bug like that in one of the recent releases.

----------


## yokesee

Sorry, my mistake I did not see the update :Frown:

----------


## fafalone

Hey no problem with the frequency I update these things even I can't keep up  :Big Grin:

----------


## fafalone

*Project Update: Version 10.0 Revision 4*
The fix introduced to stop crashing with a Thicker border was incorrectly applied to the ListView as well, and this caused graphical glitches when resizing the control too short as the ListView locked and the Details Pane and/or StatusBar were drawn on top of it.

If I find one more significant bug this whole project is getting yanked for a solid month of testing lol... again sorry for the oversight, I hadn't tested resizing StatusBar/DtPane that small.



```
'New in v10.0 R4 (Released 29 Apr 2021)
'
'-Updated GetPropertyDisplayString snd GetPropertyKeyDisplayString to handle arrays
' in the manual fallback handler for properties without an IPropertyDescription.
'
'-(Bug fix) When the StatusBar and/or DetailsPane was enabled, resizing the control
'           below a certain point caused the ListView to stop resizing, forcing the
'           bar and pane onto it, causing graphical glitches. This was related to
'           the fix put in place to stop crashes from resizing a thicker border too
'           low; that code fired when it shouldn't.
```

----------


## dmrvb

I'm really sorry but I think I've found some bugs......

Have finally found some time to have a serious look at ucShellBrowse and ShellTree. They look really good.
Initially I want to use these as a replacement/upgrade for similar controls that were sold (for significant money)
by SkySoftware/NPLogic.
I want to use ShellTree with ShellBrowse, with ShellBrowse just showing the FileList, no buttons or dropdown combo etc etc.

I've got a few bugs, issues and missing functionality, so here goes.....

1 ShellBrowse makes the IDE somewhat crashy but I assume this is the usual subclassing issue.

2 I have had your ShellBrowseDemo crash when compiled to an EXE. I will update you if I can make this repeatable.

3 ShellBrowse gives an error in the IDE when changing the viewmode "Error in ucShellBrowse_SubClass  Invalid Window Handle"
  but it still works. OK when compiled to EXE

4 Please can we have ShowHidden properties in ShellTree similar to those in ShellBrowse, otherwise the folder displays are
  incompatible.

5 The cursor in ShellBrowse is light blue, the cursor in ShellTree a darker blue, can it be the same blue as ShellBrowse please?
  Is this a user option?

6 ShellBrowse and ShellTree do not have GotFocus events, I need a way to know which control has focus.

7 BUG? ShellBrowse and ShellTree do not reliable get the focus. If I click on either control then use keyboard up/down arrow keys
  then the control does not always respond to these keystrokes. This can be demonstrated in your "ucShellTree with ucShellBrowse Demo"

8 BUG? ShellBrowse usually does a double update when changing folders, this can give obvious screen flicker. It looks like the first update
  has files/folders in alphabetical order whilst the second puts the folders first, hence a very obvious flicker. I note that
  ShellBrowse_DirectoryChanged is executed twice.

9 If ShellTree does get the focus then I can use the arrow keys to rapidly navigate the folder tree. Sometimes ShellBrowse can not keep
  up and the refreshes all get stacked up, is it possible to prevent this? I appreciate that I am pushing your control hard here
  and reporting a relatively trivial issue, but lets go for perfection???

10 What you have done is really clever and impressive. If you get any spare time how about putting some more comments in your code,
   at least a little overview of what each routine is doing? It would great to learn a bit more about how this "low level Windows Interface" stuff     works.

I will do as much testing as I can over the next week or two.

----------


## fafalone

For #3, is this with or without a Common Controls 6.0 manifest? Changing view modes during runtime is currently unsupported without it, and a couple view modes are incompatible. (As mentioned above I'm probably going to drop even trying to maintain support; if they're not enabled it probably explains a lot of your other crashes too)

4 - Absolutely, I'll add that ASAP could've sworn I had already

5 - Does your app have a custom cursor in it? The only time the cursor is usually set is a standard hourglass function in  ucShellTree: 

```
Private Sub Hourglass(fOn As Boolean)
If fOn Then
    Call SetCursor(LoadCursor(0, ByVal IDC_WAIT))
Else
    Call SetCursor(LoadCursor(0, ByVal IDC_ARROW))
End If
End Sub
```

If it's causing problems I'll just drop it though. ucShellBrowse does something similar when a file is dropped but not in folder load like the tree.

6 - ucShellBrowse raises the EnterFocus event on UserControl_EnterFocus; I can add that for the tree too, but do you mean focus on the ListView/TreeView controls?

7 - For ucShellBrowse, If lack of ComCtl6 is behind the earlier bugs, I'm inclined to think it's related to this too, since the past few versions I spent a **ton** of time working on keyboard focus for arrows and tabbing, and checked on both win7 and win10 before releases, but didn't check without comctl6.
For ucShellTree, since it's just the single control I hadn't really encountered any problems needing the fancy IPAO solution employed for the browser, but I'll definitely take another look.

8 - Through what dirchange method(s) and what settings for HighPerformanceMode, only with a shelltree, any other possibly relevant details? Can't see this on my end so need a little help replicating. Are both controls and the demo projects up to date because how they change dirs changed recently.

9 - Can you describe what you're doing in a little more detail?

10 - If you have any suggestions for what functionality you're most interested in, I can try to comment those functions... but commenting everything... We're talking 2000 methods between the two projects and you've already given me a ton to work on this week  :Smilie:

----------


## dmrvb

Thank you, I am busy for a couple of days but will then put more time into this.
I'll do a couple of posts now so they don't get to big.

Background.
I have produced software used for recording noise and vibration data (for engineering, not music) and some users
will use it in a very hostile environment where just working the PC can be a bit difficult, plus the VB file browser
controls are poor.
I have done my own little file explorer, and more importantly a file dialog that uses a Shell Tree and a ShellBrowse type component (I don't use the tree combo).These give some additional functionality that the standard windows file dialog does not have.

1 The user can easily enable/disable all dragdrop and right click menus. This will likely be enabled working in the office/lab, but disabled for field work so that clumsy fingers do not accidentally drag files to an unintended place etc etc.

2 I have done a software version that runs full screen/touch screen usually on a Surface Go. Its not so easy to navigate the
 ShellTree/ShellBrowse on a touch screen, especially when getting shaken about. I provide an optional toolbar with big buttons to
Navigate the controls. This is why I need to know the focus (most recently clicked control).
I also need functionality to navigate the tree and shellbrowse, expand and collapse nodes, and select files. I can do much of this with PostMessage but think I will need a method in ShellTree to expand/collapse nodes.

 I can try to do a screen shot if that helps.

I am trying to be semi retired, the software is quite old so I am not actively selling it anymore, just supporting existing users (mostly free of charge) by keeping everything working and up to date plus doing small user requested enhancements. However if Wayne really manages to get TwinBasic working then I might be very tempted to start a new software project.

----------


## dmrvb

Some thoughts on CommonControls6

I am sure I have got the latest versions of your controls and tests/demos so will be including your res files and hence
will be using commoncontrols6. I have just confirmed this with resource hacker. I was randomly pressing the command buttons
on your demo when it crashed. I will try again to replicate this but so far it has not crashed again. I had not rebooted Windows for several days which might be a factor.

I have mixed feelings about the commoncontrols6 requirement. Manifests are a bit tricky and I consider them to be a thing
for "VB power users". I would be good if your Browser, at least the OCX version, could work with "standard VB".
However I think we have to accept that Windows has moved on and manifests and side by side installations are the way to go.
Maybe because VB is now old the casual users have all gone and its only used by more experienced programmers who are happy with API calls, manifests, and side by side etc????
I will put manifest generation as a feature request on the TwinBasic site  :Smilie: 

Concerning additional functionality, I note that the old controls from LogicNP are still available for download (I expect with watermarks and nagscreens).
Maybe you could have a look to see what functionality they provided if you are interested.
These were good controls but are no longer supported and some Windows10 updates have made them unreliable.

http://www.ssware.com/megapack/builds_ocx.htm

----------


## fafalone

1) Both right click menus can already be disabled, with EnableViewMenu for the background view menu, and EnableShellMenu for the context menu when clicking on files. I'll add an option to disable the context menu in shell tree. 
If it's for drag and drop, in shelltree that can be disabled with the DisableDragDrop option, in shellbrowse via the FileDragDropMode selection.

2) For the dropdown in ShellBrowse this might be a bit of a problem, but I'll review keyboard functionality to see if I can add any more, should be able to make the right arrow expand in the treeview easy enough.


-
For ComCtl6, it's going to be preinstalled. All you need to do is add the .res containing it in your project. You don't need to worry about anything else; Windows Vista and newer all have it preinstalled, and if you're needing to support XP unfortunately this project won't work at all (I specifically designed it to show off newer shell features). 

You don't need to distribute comctl6, you don't need to distribute a .manifest file, you just need it inside the .res that's in your project when you compile it. That's it, no other files to worry about besides your .exe (and any requirements unrelated to the control). 

Sorry I haven't had a chance to get into this more, I should be able to when I get home tonight.

----------


## dmrvb

I have now had a really good look at these controls and continue to be very impressed.
Having access to the source code is great, and having them written in VB is even better.
I have made my own little test program to evaluate these, it crashes quite often in the IDE but the compiled EXE is file.
Here is a slightly expanded list of bugs, issues, and requests for additional functionality.

ucBrowse

1 Double update sometimes giving noticable flicker

2 Not consistently getting focus (click the listview, then pressing up/down arrow on keyboard
  does not always send these keystrokes to the control.)
  ucTree has similar issue.

smaller issues

3 Selecting a file with .SelectedFile = name is case sensitive
  Probably better if it is not, or could this be an option????

4 When selecting a file then if it is not visible it does not become visible
 (user needs to scroll to find the file)
 Automatic scrolling to make the file visible would be good, an "EnsureVisible" method even better.

>>>>>>>>>>>>>>>>>>>> Extra Functionality.

ucTree

5 An EnterFocus event.

6 a SetFocus method equivalent to SetFocusonFiles in ucBrowse

7 "Show Hidden" functionality similar to ucBrowse

8 a property to disable the right click menu.

ucBrowse

9 a method to select an item by location, in paticular to select the first item.
(maybe I can already do this?.....am working on it)  

ucBrowse and ucTree

10 Control of cursor/highlight colours
...when I say cursor I mean the highlight bar showing the selected component, not the mousepointer

Its a different shade of blue in ucBrowse and ucTree.
Can they be the same? even better can this be a user property please?

(you give user control of the background colour so it would make sense to have
user control of this too?)

and what would be really good....

when the ucTree/ucBrowse does not have the focus the highlight bar becomes a very light
grey colour (at least on my PC), could we have a property to control this colour too?

11 Rapid Update/refresh problem.

When navigating the ucTree rapidly with keyboard up/down keys the ucBrowse can sometimes not
update quickly enough and the updates stack up.
I have had a look at my current LogicNP controls to see how they behave....
If clicking a folder in the Tree then the list/browse updates imediately.
If navigating with the keyboard a short delay is built in (I estimate about 700msec) and the list update
only occurs if no other navigation has taken place in this time. 

12 Possible issue with "My Computer" display, more details later

----------


## MountainMan

Fafalone,

I am incorporating ucShellBrowse and ucShellTree into a new file manager and I need a bit of help on drag'n'drop.  Catching a drop onto either control with file paths is okay but I haven't yet figured out how to tell where within the control the drop occurs. I get that the mouse position is given when the drop occurs but to get the item it was dropped on I think I need to be able to get location parameters for each of the items in the control. I am sure it is in here somewhere but I don't see it. What am I missing? Thanks.

----------


## fafalone

To tell where the drop occured you'd look at the parent path given in the event that's raised... if it's the same as the current path, it was dropped on the background, if not, it's been dropped on the file. 

Public Event DropFiles(sFiles() As String, siaFiles As oleexp.IShellItemArray, doDropped As oleexp.IDataObject, sDropParent As String, siDropParent As oleexp.IShellItem, iEffect As oleexp.DROPEFFECTS, dwKeyState As Long, ptX As Long, ptY As Long)

sDropParent will contain the path it was dropped in, which could be either the current path (.BrowserPath) or the full path of a subfolder or file within that, if ActiveDragDrop is enabled, depending on exactly where you dropped it. siDropParent is an IShellItem for sDropParent. 


Also, I'm back around  :Smilie:   Got home a couple weeks ago like I mentioned in email but my old computer's motherboard completely crapped out. Just finished a new system build upon which I was infuriated to find that despite careful hardware selection I couldn't get it to run Windows 7 (installed but wouldn't boot), and spent a week fighting with Windows 10 because MS now believes it's *their* computer and doesn't allow you to turn off Windows Defender even in the LTSC edition where you can lock down telemetry. Had to use recovery mode to be allowed to edit my own registry, can you believe that? Anyway, I'll be slowly getting back into the swing of things here. Probably forgot a lot of the details of exactly what I was doing last.

----------


## fafalone

> I have now had a really good look at these controls and continue to be very impressed.
> Having access to the source code is great, and having them written in VB is even better.
> I have made my own little test program to evaluate these, it crashes quite often in the IDE but the compiled EXE is file.
> Here is a slightly expanded list of bugs, issues, and requests for additional functionality.
> 
> ucBrowse
> 
> 1 Double update sometimes giving noticable flicker
> 
> ...


1- Can you describe in more detail? There might be a little flicker but it only updates the redraw every once in a while so hasn't been too bad in a while; is this with the default settings or with other options for high performance mode and preloading?

2- Ugh.. you can't imagine how many hours I spent trying to get focus to work. I don't know that it can possibly get better than the extremely complicated focusing system it's got now due to inherent limitations of VB6 apps on modern Windows, but if you can be more specific on how I could replicate the exact issue (and on what OS) I'll give it a shot.

3- Could definitely make it an option. I honestly don't recall right now (I've been on hiatus from all things programming for 8 months or so-- btw, sorry for the long delayed reply due to that) whether there's an problems adding an Optional to a PropertyLet, but since there are none in the control...
If you wanted to update yours until I work that out, you could make it case insensitive as follows:

-Go to Public Property Let SelectedFile(sName As String)

-Change If LVEntries(lp).sName = sName Then to If LCase$(LVEntries(lp).sName) = LCase$(sName) Then

Edit: Here's the new function I'm going to be adding to the next version, since it's impossible to add Optional arguments to the previous one. This one is much better, it allows wildcards... so if Multiselect is enabled you could e.g. select *.exe:


```
'First, this new enum will be added up in the control defs:
Public Enum SB_ITEMSEL_MODE
    SBIM_FilesAndFolders = 0&
    SBIM_FilesOnly = 1&
    SBIM_FoldersOnly = 2&
End Enum

'Then this function is added:
Public Function SetSelectedItemsEx(sName As String, Optional bDeselectPrev As Boolean = True, Optional nMaxMatches As Long = 0&, Optional iSelectType As SB_ITEMSEL_MODE = SBIM_FilesOnly, Optional bEnsureVisible = True, Optional bCaseSensitive As Boolean = False) As Long
'bDeselectPrev - Clears any existing selection.
'nMaxMatches - If sName contains wildcards, specifies maximum matches. 0 = unlimited. Does not override Multiselect; so if Multiselect is False, any value larger than 1 is invalid.
'iSelectType - Match sName against Files only, Folders only, or both.
'bEnsureVisible - Scrolls the selected item into view. If multiple selections made, applied to the first match.
'bCaseSensitive - Applies both with and without wildcards.
'Returns files selected.
'Note: First match receives focus.
Dim i As Long
Dim lp As Long
Dim lCnt As Long
Dim sCp1 As String, sCp2 As String
Dim nMt As Long
Dim nEV As Long

lCnt = SendMessage(hLVS, LVM_GETITEMCOUNT, 0&, ByVal 0&)

If bDeselectPrev Then
    ListView_SetItemState hLVS, -1, 0&, LVIS_FOCUSED Or LVIS_SELECTED
End If

For i = 0 To (lCnt - 1)
    lp = GetLVItemlParam(hLVS, i)
    If (iSelectType = SBIM_FilesOnly) And (LVEntries(lp).bFolder = True) Then GoTo nxt
    If (iSelectType = SBIM_FoldersOnly) And (LVEntries(lp).bFolder = False) Then GoTo nxt
    sCp1 = LVEntries(lp).sName: sCp2 = sName
    If bCaseSensitive = False Then
        sCp1 = LCase$(sCp1): sCp2 = LCase$(sCp2)
    End If
    If PathMatchSpecW(StrPtr(sCp1), StrPtr(sCp2)) Then
        nMt = nMt + 1
        If nMt = 1 Then
            ListView_SetItemState hLVS, i, LVIS_FOCUSED Or LVIS_SELECTED, LVIS_FOCUSED Or LVIS_SELECTED
            nEV = i
        Else
            ListView_SetItemState hLVS, i, LVIS_SELECTED, LVIS_SELECTED
        End If
        If ((nMaxMatches > 0&) And (nMt = nMaxMatches)) Or (m_MultiSelect = False) Then Exit For
    End If
nxt:
Next i
LVSetSelection
If nMt Then SendMessage hLVS, LVM_ENSUREVISIBLE, nEV, ByVal 1&
SetSelectedItemsEx = nMt
End Function
```

4- An exposed EnsureVisible method is a great idea, will definitely add in next update. In the mean time of course you could add SendMessage hLVS, LVM_ENSUREVISIBLE, i, ByVal 1& at the end. 

5-8- You're right probably should have had those already. 

9- There's not a 1-and-done method for that, but you could certainly navigate to a path, set a module-level flag, then when receiving a DirectoryChanged event, which fires after the new one has been loaded, if your flag is True use .SelectFile to select a specific file, or call SetFocusOnFiles True[,True] to select the first file-- the first True is the option to select the first file if none if already selected (which will be the case with a newly loaded folder), and the 2nd True, if used, is to ensure you select the first *file*, as in ignore the folders. 

10- Definitely haven't seen them in different colors before, and I test the demos where they're both loaded in both Win7 and Win10... I'm not sure how that's possible unless the ExplorerStyle option is set to a different value in one control than the other, they both default to enabling it. It's controlled by windows; the control would have to be 100% owner draw to change that.

When the control selection color goes to gray when out of focus or not is controlled by the ShowSelAlways option, which is available in both controls.

11- I'll take a look at this behavior. There are some timing codes in there that prevent bugs, could be causing that.

12- Let me know; I've tested the items my system has to display in Windows 7 and an older Windows 10 version, it's possible other items or newer Windows versions have issues. There are some known issues with the display in Windows 10. Certain items report properties they shouldn't have, resulting in e.g. drawing percent full bars for special folders that aren't drives... these need to be flagged manually.

Edit: I might know what you mean. I hadn't noticed it on the Windows 10 version on my laptop, but on my new system... it's grouping the Special Folders with the drives. This is due to an error where it's failing to get the relative pidl of the folders in the initial loop where the Categories are detected (something only applicable in this very special case). It seems the folders get suitable relative pidls elsewhere, so I fixed this by making, in LVLoadFolder, this bolded line conditional (adding the If statement):


```
                If LVEntries(nCur).pidlRel = 0& Then
                    psfCur.ParseDisplayName hLVS, 0&, StrPtr(LVEntries(nCur).sNameFull), 0&, LVEntries(nCur).pidlRel, 0&
                End If
```

----------


## MountainMan

Fafalone,

I have a request for your next update.

You use FILETIME fairly often in ucShellBrowse.ctl and usually you reference oleexp.tlb in the type or variable declaration by calling it "As oleexp.FILETIME" but there were 4 references where you did not do that and this caused a conflict with some of my code. I added "oleexp." in front of FILETIME on lines 2684, 2685, 2686 and 2687.

Also, the same is true with your use of RECT. I put "oleexp." in front of RECT on lines 29701, 37190 and 37191.

By doing this I was able to make the naming conflicts go away.

I checked ShellControl.ocx and there is no conflict, it's just with the .ctl file. this is good but I was thinking about expanding the utility I wrote for Krool's CCR controls to include yours so that a developer can use the OCX file for development (faster & more stable) but then compile with the .ctl file so the distribution package doesn't need the ocx. if I did this then the .ctl compile would fail with things as-is. Personally I am okay since I edited your .ctl file but it would be nice to avoid the hassle for others and so I don't have to edit your .ctl file for future updates.

As a nit-pick, I think your definition of FILETIME in oleexp.tlb is backwards from what it actually is. You have it defined as the high Long and then the low Long but Windows defines it the other way. In your code (and mine), this structure is passed as-is to the Windows call FileTime ToLocalFileTime which then is passed as-is to FileTimeToSystemTime which is then passed as-is to your function SystemTimeToDate which pops out a VBA-type Date value. So even with it defined backwards the Longs are not used separately so there is no problem. But if someone wanted to use the Longs as defined there would obviously be problems.

Thanks.

----------


## dmrvb

Hello Fafalone
It can be good to have a break from software. I have not done much with these controls while you have been away, it will take a couple of days to get back into them.
To make a start,
The screen flicker is because the uclist (shellbrowse) control does a double update, first with the files first, then with the folders first, hence the flicker. This only occurs (or is only visible) on folders containing a lot of files and subfolders.
I select a folder in ucTree, this execute "ucList.BrowserOpenItem ucTree.SelectedShellItem" and this gives the double update. This is confirmed by putting a debug.print in "ucList_DirectoryChanged".
I think this is intrinsic behaviour rather than a "race condition" between ucTree and ucShellBrowse.
Interesting observation    problem does not occur if I set uctree.MonitorDirChanges = false
.....more in a day or so

----------


## fafalone

@MountainMan, thanks, I missed changing those in some newer features.

As for the prder, I believe you're looking at the display order in the VB6 IDE, which sorts them alphabetically, in the oleexp source, it's defined properly, see types.inc line 15:


```
typedef struct FILETIME {
	LONG dwLowDateTime;
	LONG dwHighDateTime;
} FILETIME;
```


@dmrvb, Ok, will take a look.

----------


## fafalone

> Hello Fafalone
> It can be good to have a break from software. I have not done much with these controls while you have been away, it will take a couple of days to get back into them.
> To make a start,
> The screen flicker is because the uclist (shellbrowse) control does a double update, first with the files first, then with the folders first, hence the flicker. This only occurs (or is only visible) on folders containing a lot of files and subfolders.
> I select a folder in ucTree, this execute "ucList.BrowserOpenItem ucTree.SelectedShellItem" and this gives the double update. This is confirmed by putting a debug.print in "ucList_DirectoryChanged".
> I think this is intrinsic behaviour rather than a "race condition" between ucTree and ucShellBrowse.
> Interesting observation    problem does not occur if I set uctree.MonitorDirChanges = false
> .....more in a day or so


Can you tell me more about what settings you're using? I can't seem to replicate this... I get a single ucShellBrowse_DirectoryChanged message regardless of whether I navigated through the tree or the browser. Perhaps set dbg_PrintToFile to True and attach the debug log it creates? Even better if on the host form you can take the ucShellTree_DebugMessage event and use ucShellBrowse.DebugLogInsertMessage "[ST]" & sMsg, so it gets the sequence.

Does this happen in an unmodified version of DemoEx and/or DemoOpenDlg?

(Just to confirm, you are on the latest version right? I know a very long time ago it was duplicating directory loads when combined with the tree)

----------


## dmrvb

This is strange.
I am using Shellbrowse 10.0.R4 and I now know its ShellBrowse rather than ShellTree that is the problem.
I have just made a new VB6 project with a single form containing a single ShellBrowse (using the code directly, not a compiled ActiveX). I have not changed any properties so they are all the default values.
I have put a single command button on the form that executes ucShellBrowse1.NavOpenParent and used the ShellBrowse and this button to navigate my file structure. I see the double update flicker on bigger folders, and debug.prints in directorychanged event confirm the double update on every folder navigation.
I am running windows 10 on an HP laptop.
I will compile to an EXE and use a textbox in place of the debug.prints and try it on a different computer. Will report back later with results, and also some info regarding Focus issues.

----------


## dmrvb

Good news   Double update only occurs in VB6 IDE, compiled EXE is fine, so I propose that this is a "feature" rather than a bug, sorry if you have spent much time on this. I will now start looking at the focus limitations.

----------


## dmrvb

Focus Issues

I share your observation than VB6 focus can be a frustrating thing, I have had to use API calls in some of my projects to sort things out.

I have Shellbrowse and a ShellTree working together on a Form (my own test/evaluation project). The ShellBrowse is set to display just the ListView and no other components.
I would like to be able to click on either control to get it focused and then use keyboard up/down arrows to navigate.

1 If I click on shellBrowse (SB) then click on ShellTree (ST) ST highlight bars get highlighed so looks to have focus but does not respond to keyboard. ucTreee.EnterFocus does not fire.
2 If I call SetFocusAPI (ucTree.hWndTreeView) (from a command button) then this does correctly focus the ST, it gets the keyboard commands, but still does not fire then EnterFocus event.
3 ShellBrowse works well and does fire its EnterFocus and ExitFocus events. It responds to the keyboard but does NOT respond to the up and down arrow keys.
4 Clicking on SB then ST does not fire the ShellBrowse.ExitFocus because ST does not really get the focus.

----------


## fafalone

I was working on focus issues tonight.... the IPAO calls weren't set up right in ucTreeView. 

It seems to be working completely since I resolved that and another bug... but the real test will come when I test it with tabs and on Win7 later. But at least the switching back and forth between controls is resolved; I've got that working pretty good.


I'm going to take a look at the double loads later... it's odd it only happening in the IDE; What's the location like? If it's within a special folder or network location, there could possibly be an issue where it's representing the path name different so not blocking the duplicate load. But I'll attempt to replicate in a fresh project; it might be something about NavOpenParent, I hadn't checked to see if that in particular might cause a duplicate; it's not in the demo I already have set up, but will try a brand new one.

(PS- You don't have to worry about setting up a textbox for the EXE, all you have to do is toggle dbg_PrintToFile to True and the control automatically writes all debug output to a text file.)

----------


## fafalone

*Project Updated to Version 11.0
*
I've added all the requested features and fixed most of the bugs identified by others as well as a few more I found. There's still a bit of work to go but they're for minor issues, and some of the bugs that were outstanding I didn't want to wait anymore. So I'm by no means done, but this is a much improved version in the mean time. 

The companion control ucShellTree has also been updated to v2.7, you'll need that to correct the keyboard focus issue between the two controls.

The new Explorer-style selection is where you can drag from within column whitespace to create a selection rectangle:

Previously this would start a drag drop, and you had to go past the last column or below the last item to start the marquee. It works in all columns. Dragging from the actual filename/file icon still initiates a drag/drop (if enabled). 
For a demo applying this to any ListView, see [VB6, Win7+] Undocumented ListView Feature: Multiselect in columns like Explorer




```
'New in v11.0 (Released 25 Jan 2022)
'
'
'-Added option ExplorerStyleSelection. Makes the ListView work like Explorer; if
' in Details View with Multiselect enabled, you can start a marquee to select
' multiple files by dragging in the whitespace of the Name column, rather than
' need to go off to the side. Enabled by default.
' Note: Does not work in Windows Vista.
' Note: This is an undocumented ListView feature. As such, it may be dropped from
'       future versions of Windows. However, it's confirmed to be working in
'       Windows 10, and it will simply stay with the old selection style if the
'       call fails, it will not break the control.
'
'-Added ClearSelection method to deselect all items.
'
'-Added new public SelectedFileSet sub with more options; allows select/deselect,
' separate option for focus, option to deselect all others, and ensure visible.
' SelectedFile (Let) wasn't changed since optional arguments aren't allowed and
' adding non-optional ones would break people's existing code.
'
'-SelectedFile (Let) is no longer case sensitive, since filenames are not.
'
'-New SetSelectedItemsEx function that provides a far more robust way of selecting
' files. Supports wildcards for selecting many, limiting to files or folders,
' setting a match limit, and more.
'
'
'-(Bug fix) High performance mode was broken on Windows 10.
'
'-(Bug fix) On some special editions of Windows 10, including LTSC, special folders
'           are not included, causing the Bookmarks menu to not show due to a bug
'           in handling errors generating that submenu.
'
'-(Bug fix) Some FILETIME and RECT types weren't explicitly defined, leading to
'           naming conflict errors in certain scenarios.
'
'-(Bug fix) On some versions of Windows 10, Special folders in This PC were grouped
'           with the drives.
'
'-(Bug fix) On Windows 10, some Security Zone icons failed to load.
'
'-(Bug fix) Keyboard focus never went to ucTreeView when on a form w/ ucShellBrowse.
'
'-(Bug fix) The arrow keys wouldn't work on the first click of the ListView.
```

Note: For a brief time when this was initially uploaded, there was a stray Debug.Print statement in FindFirstFileNt that should have been commented out or DebugAppend instead. 10 people grabbed it before I changed it, if that's you, it can safely be commented out. DemoFileProc also had an extra control that shouldn't have been there.

----------


## dmrvb

Thankyou
I have downloaded the new versions and had a very quick look, I will look in more detail over the next couple of days.
Initial tests indicate that the double update is fixed.

----------


## fafalone

That's weird, since that was one of the minor things I hadn't tracked down yet  :EEK!: 

Btw, to automatically select the first file I didn't include a dedicated function, but the new SetSelectedItemsEx method can be used to do that... to select the first file (and only file, not folders):

ucShellBrowse1.SetSelectedItemsEx "*", True, 1&, SBIM_FilesOnly, True

*=match anything, true=deselect others, 1& = stop after 1 match, FilesOnly excludes folders, and the last True is Ensure Visible.

In the stealth update I made before I added an additional parameter to there concerning .zip files.... if it's set to browse them (BrowseZip = True), they're treated as folders by default, otherwise, as files. bZipIsFile can be set to 1 for always consider folder, 2 for always consider file. Not setting it follows the default.

Here's the full arguments for that function:



```
'bDeselectPrev - Clears any existing selection.
'nMaxMatches - If sName contains wildcards, specifies maximum matches. 0 = unlimited. Does not override Multiselect; so if Multiselect is False, any value larger than 1 is invalid.
'iSelectType - Match sName against Files only, Folders only, or both.
'bEnsureVisible - Scrolls the selected item into view. If multiple selections made, applied to the first match.
'bCaseSensitive - Applies both with and without wildcards.
'bZipIsFile - 0: Follow BrowseZip setting, 1: Always folder, 2: Always file
'Returns files selected.
'Note: First match receives focus.
```


There's also SelectedFileSet that's just for one file, no wildcards:
Public Sub SelectedFileSet(sName As String, bSelected As Boolean, Optional bDeselectOthers As Boolean = False, Optional bFocused As Boolean = True, Optional bEnsureVisible As Boolean = True)

----------


## dmrvb

Its all looking good, but am still finding a few little issues that I will investigate further.
Main problem is an intermittent total crash. I get this in the IDE but sometimes in the compiled EXE. It usually occurs after a lot of browsing and other activity but does not appear related to any specific action. I will try really hard to get more specific info.

There is something odd about fonts in the IDE. If I change any font detail and then make an EXE the fonts jump back to their previous settings.
Also in the IDE when changing ViewMode I get an error box "invalid window handle" from ucShellBrowse.ssc_SubClass
I have also seen this messagebox in a compiled EXE, I think (not sure) this was an EXE compiled without the manifest whilst investigating another oddity.

----------


## dmrvb

I can now get a total crash of ShellBrowse in a moderately consistent way.
I have done this in a compiled version of my own test software, but have also replicated it in a compiled version of your "ShellBrowseDemo" (ShellBrowse v11 RC1 std01.exe). 

Navigate up to MyComputer then make many selections of different ViewModes. Making between 10 and 30 random selections should get a crash. There might be a specific sequence but I have not found that yet.

----------


## dmrvb

Another interesting behaviour..
In my test software if I navigate up through ShellBrowse using NavOpenParent then it goes up to Desktop and then stops/no longer responds to NavOpenParent. This is good.
If I link the ShellBrowse to a ShellTree then NavOpenParent  continues to respond and loops between DeskTop and MyComputer and this feels wrong. 
This is part of the mechanism...
NavOpenParent fires ShellBrowse.DirectoryChanged and this call ShellTree.OpentoItem
OpentoItem does NOT fire ItemSelect
However when ShellTree gets to DeskTop it Does fire ItemSelect and this calls ShellBrowse.OpenToItem. This gives a visible double update but also somehow sets ShellBrowse to a DeskTop that now does respond to NavOpenParent.
I hope this makes sense????

----------


## fafalone

> Its all looking good, but am still finding a few little issues that I will investigate further.
> Main problem is an intermittent total crash. I get this in the IDE but sometimes in the compiled EXE. It usually occurs after a lot of browsing and other activity but does not appear related to any specific action. I will try really hard to get more specific info.
> 
> There is something odd about fonts in the IDE. If I change any font detail and then make an EXE the fonts jump back to their previous settings.
> Also in the IDE when changing ViewMode I get an error box "invalid window handle" from ucShellBrowse.ssc_SubClass
> I have also seen this messagebox in a compiled EXE, I think (not sure) this was an EXE compiled without the manifest whilst investigating another oddity.


This issue has happened before; it relates to switching views during runtime being unsupported without ComCtl6, so the entire ListView has to be destroyed and recreated. I'm really not sure it makes sense to continue attempting to support the control without ComCtl6, that's likely the source of a lot of the bugs and instability. 




> I can now get a total crash of ShellBrowse in a moderately consistent way.
> I have done this in a compiled version of my own test software, but have also replicated it in a compiled version of your "ShellBrowseDemo" (ShellBrowse v11 RC1 std01.exe).


Weird. Happens for me too, so will look into it. 




> Another interesting behaviour..
> In my test software if I navigate up through ShellBrowse using NavOpenParent then it goes up to Desktop and then stops/no longer responds to NavOpenParent. This is good.
> If I link the ShellBrowse to a ShellTree then NavOpenParent continues to respond and loops between DeskTop and MyComputer and this feels wrong.
> This is part of the mechanism...
> NavOpenParent fires ShellBrowse.DirectoryChanged and this call ShellTree.OpentoItem
> OpentoItem does NOT fire ItemSelect
> However when ShellTree gets to DeskTop it Does fire ItemSelect and this calls ShellBrowse.OpenToItem. This gives a visible double update but also somehow sets ShellBrowse to a DeskTop that now does respond to NavOpenParent.
> I hope this makes sense????


Sounds easy enough to fix... I had been relying on the UI element being enabled but if I add a variable to keep track of whether it's been disabled or not I can flag whether to let a call to OpenParent go through.

----------


## dmrvb

I am using the CC6 manifest.
I have found a few issues with the display of This PC.
The names of the disk drives are missing, and my iPhone is identified as UDB#vid_05...rather than as "Iphone".
I have tracked this down to my setting of FileExtensions = SBEP_AlwaysShow,
If I select FileExtensions = SBEP_UseExplorer then the display is correct, even though Explorer is set to display File Extensions.

Yesterday I reported that I could get a hard crash by changing DisplayMode whilst displaying This PC. I can also get the crash without changing DisplayMode but am starting to suspect that the crash only occurs when This PC is displayed. It certainly mostly occurs when This PC is displayed. I will test a bit more.

----------


## dmrvb

SelectedFileSet selects the file Before the specified file rather than the specified file
SelectedFile =      has the same problem.

When we Browse to a new folder should the first displayed item be automatically selected?????
and if not done automatically is there a way to do this in code?

----------


## fafalone

The name issue... is complicated. I need to do a complete overhaul of how it figures out what name to display. The problem is it's incredibly complex like you wouldn't believe... the display name may or may not have the file extension depending on the setting... but then, even if showing extensions are on, .lnk and .url are hidden anyway, and the control needs to know if they're links or shortcuts. Then the parsing name is different depending on where you get it from, there's multiple friendly names, and dozen other complications that have resulted in a spaghetti mess I really need to rework from scratch. So I'm going to take a few days before updating to do that and look into the crashing issue (I'm going to check if it's other special locations too, if it's really just This PC it could be an issue with the ICategorizer system, which only that folder seems to implement).  


The selection issue in SelectedFile can be fixed by changing     If LCase$(LVEntries(*i*).sName) = LCase$(sName) Then to     If LCase$(LVEntries(*lp*).sName) = LCase$(sName) Then

For SelectedFileSet, just replace it with this version


```
Public Sub SelectedFileSet(sName As String, bSelected As Boolean, Optional bDeselectOthers As Boolean = False, Optional bFocused As Boolean = True, Optional bEnsureVisible As Boolean = True)
Dim i As Long
Dim nItm As Long
nItm = -1
Dim lp As Long
Dim lCnt As Long

lCnt = SendMessage(hLVS, LVM_GETITEMCOUNT, 0&, ByVal 0&)
ListView_SetItemState hLVS, -1, 0&, LVIS_FOCUSED Or LVIS_SELECTED

For i = 0 To (lCnt - 1)
    lp = GetLVItemlParam(hLVS, i)
    If LCase$(LVEntries(lp).sName) = LCase$(sName) Then
        nItm = i
        Exit For
    End If
Next i
If nItm = -1 Then Exit Sub

If bDeselectOthers Then ListView_SelectNone hLVS

Dim lvi As Long
If bSelected Then
    lvi = LVIS_SELECTED
    If bFocused Then
        lvi = lvi Or LVIS_FOCUSED
    End If
    ListView_SetItemState hLVS, nItm, lvi, lvi
Else
    ListView_SetItemState hLVS, nItm, 0&, LVIS_SELECTED
End If

If bEnsureVisible Then
    SendMessage hLVS, LVM_ENSUREVISIBLE, nItm, ByVal 1&
End If

End Sub
```

Selecting the first item... I didn't intend for it to be done as Explorer and most programs don't do that, but I can add an option to do it automatically, or you can do it programmatically already by putting the method in post #208 in the DirectoryChanged event. That method doesn't have the i vs lp issue the others have so no need to update anything.

----------


## dmrvb

Thank you again for all the effort you are putting in, but these are really good and useful (essential?) controls.

Ive been clicking away at my test program for a while now and I have not managed a hard crash at all except when displaying "This PC" so I am increasingly confident that something in "This PC" is the source of the crash. 
My PC has gone really slow and needed a reboot so the crash is probably hurting windows too?.

----------


## fafalone

*Project Updated to 11.1
*

Most of the bugs mentioned above have been fixed. I did a temporary fix with the names; I wanted to get an update out with that and fixing the file select bugs before refactoring the whole file name tracking system, which desperately needs to be done but will take a while. Also planning on trying a new IPAO system for keyboard focus... the current one is a hacked together mess.



```
'New in v11.1 (Release 02 Feb 2022)
'
'-Provided some advanced item data access. zz_ExportSelectedItemFullData and
' zz_ExportItemFullDataByPos export the full internal item data structure.
' How to use these:
'   Step 1: Copy type definitions for UCSBFile, UCSBF_ColLink, and ColumnCache
'           to the calling form/module.
'   Step 2: Declare a UCSBFile variable, and 3 Long's to be passed as arguments
'           for the function: One to receive the memory pointer, and array
'           bounds for the LinkCols and ExtColData arrays in UCSBFile.
'   Step 3: Redim UCSBFile.LinkCols(nLinkCol) and UCSBFile.ExtColData(nExtColData)
'   Step 4: CopyMemory to UCSBFile from ByVal pData (only if function returns >0!)
'
'-Also added InvokeKeyPress to invoke a key press on the ListView by code. Has
' options for Shift/Control/Alt and whether to raise the ListKeyDown event.
'
'-CustomColor event now includes dwState argument that passes the CDIS_* values
' in NMLVCUSTOMDRAW.iStateId.
' ***EVENT PROTOTYPES ON YOUR FORMS MUST BE UPDATED!***
'
'-Set the ListView LabelEdit edit box length limit to MAX_PATH, to avoid an error
' when attempting rename.
'
'-(Bug fix) In high performance mode, showing hidden would also show superhidden
'           as the FILE_ATTRIBUTE_SYSTEM attribute wasn't checked.
'
'-(Bug fix) SelectedFile(Let) and SetSelectedFile selected the wrong file.
'
'-(Bug fix) If FileExtensions was set to AlwaysShow, drive names in This PC would
'           not be displayed at all, and some virtual items displayed GUIDs.
'
'-(Bug fix) When switching into some view modes without ComCtl6, an "Invalid
'           Window Handle" error would be displayed.
'
'
```

For reference, the new ucShellBrowse_CustomColor prototype is: 


```
Private Sub ucShellBrowse1_CustomColor(ByVal itemIndex As Long, ByVal ItemName As String, ByVal SubItemIndex As Long, ByVal SubItemProp As String, ByVal dwStateCD As Long, ByVal dwStateLV As Long, rgbFore As Long, rgbBack As Long)
```

I did update the Demo that uses it, but if you get a 'description doesn't match' error, the above is what to replace it with (or delete it and paste the code back into a new one).

I might have also fixed the crashing in This PC. I got up to 35 before giving up, and a few bugs emerged... switching into List from Details (possibly others) after the 10th-15th time results in the names disappearing, but they come back when refreshed or put into another view. And the dumb drive used % bar for '3D Objects' somehow reappears deep into the repetitive switching; no idea how it evades the manual check, but wasn't going to delay release for that or the other thing. 
Possible cause: This PC uses a unique ICategorizer object to create categories that aren't traditional groups... having the same grouping as Explorer depends on this complicated, poorly documented, buggy interface, and it's parent, ICategoryProvider. Requesting ICategorizer from the provider with a *void causes a crash, so I had to use a Long to get the pointer, then the undocumented vbaObjSetAddref. I theorized that setting the object that way resulted in it not being automatically released when it goes out of scope when LVLoadFolder exits. So I manually set them both to Nothing before the end of the sub, and can't currently get it to crash anymore. But I also recently rebooted so who knows, it could related to that and still coming.

PS- One new known issue not fixed yet; GetFileVersionInformation/VerQueryValue isn't working right for me... if others have this issue too, it's making the control think it's running under Windows 8 when it's on Windows 10. It only effects the Windows version displayed in the About box; the only feature checks look for Win8+ or Win7.

----------


## dmrvb

Bad news, I have only done a very quick test but,
With extensions always shown and in This PC...
USB device (Iphone) is still wrong.
Disk drives now show the drive letter but do not show the name
The crash is still present.  I can usually get it after about 6 changes of displaymode, but sometimes a few more.

----------


## fafalone

What's the exact name it's showing for your iPhone? I added a filter for ::{GUID} names, uuid: names, and \?\usb# names... wasn't aware of any other path formats.

The drive names aren't showing now by design, it's until I more thoroughly fix up the names. 

With the crashing, is this changing view modes with comctl6 not available? Also, IDE or compiled... looks like I can still get my compiled exes to crash with enough clicks, but it's not happening in the IDE anymore even at 50+. VB has a ton of weird memory issues. Something must still be leaking when compiled but not in the IDE, unless you're getting that too (my IDE has Comctl6 enabled).

Edit: Actually, can you confirm whether or not you get the crash if you exclude Tile View from the modes you switch in and out of? That appears to be the reason why the reload routine is getting called just for a view switch. I can't get my compiled exe to crash either if I don't use Tile View.

----------


## dmrvb

The iphone shows as:
usb#vid_05ac&pid_12a8&mi_00#6&1115849b&0&0000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}

but again this only happens when  .FileExtensions = SBEP_AlwaysShow, otherwise its fine.
I am doing all serious testing in the compiled EXE of my little test app as this is really what matters. My IDE is running in XP compatible mode (I can't remember why) so is not good for serious testing.
However have just tested now and can Not get a crash in the IDE
I am using your manifest in my test app so am using CommonControls6 (I have not changed the EXE name in the manifest but I don't think this matters?) Your help-about screen confirms commoncontrols6.
I am using Radio (option) buttons to select from 6 display modes which makes clicking a bit less tedious.
I have done quite a bit of GDI stuff so know just how difficult memory leaks can be.
I wish I could help, have had a good look at your code and don't currently have enough low level knowledge of Windows to really contribute.

----------


## fafalone

Ok, can add a filter for that on in LVLoadFolder for now too,
            If (Left$(sNameFull, 3) <> "::{") And (Left$(sNameFull, 5) <> "uuid:") And ((InStr(sNameFull, "\?\usb#")) = 0) And (Left$(sNameFull, 7) <> "usb#vid") Then


Let me know if the crashing is happening without Tile Mode included, that would help narrow it down if that's the reason.

----------


## dmrvb

I have currently included 6 display modes in my option buttons, this does Not include Tile Mode.
They are details/list/smallicon/mediumicon/thumbnail/contents.
The crash is when displaying ThisPC with extensions selected.
List sometimes looses its text 
SmallIcons gives a double update when displaying ThisPC
The crash occurs most often (but not always) on thumbnails and contents, but maybe this is only because these are bottom of my list and I work down the buttons in sequence????

----------


## fafalone

'Contents' mode is a variety of Tile mode; they both set the view to LV_VIEW_TILE; Contents just applies the LVTVIF_EXTENDED flag.

This seems promising. I've got some special handling code for This PC switching in and out of Tile View, but hadn't applied that to Contents view. So first I'd be curious if it happens without that in the loop too.

Thumbnails has always been a stability problem though.

----------


## dmrvb

If any display modes are really difficult or likely to be unstable then let me know and I will just not make them available in my software. There are too many view modes anyway, and some of them (list and small icons for example) are of limited usefulness. I would rather limit the choices available than have software likely to crash.
This project looks really difficult so maybe its best to concentrate of the core functionality and avoid spending time on some of the less important and badly behaved options????? 
"This PC" looks to be a real source of trouble.
I have just investigated setting "ComputerasRoot= true" in both the tree and shellbrowse and this gives problems, so maybe this is one of those options best not supported?
Setting it at  runtime causes the shellbrowse display to totally fail.
Setting it at design time mostly works but the tree and shellbrowse do not always synchronise.  
I will provide more detail if you think this is worth investigating.

----------


## fafalone

Yeah contents mode is particularly problematic, I honestly thought I had it disabled in the default 'RestrictViewModes' string. Explorer has a 'Contents' option but it's apparently entirely different than the one they provide for the ListView. The UserOption I have from prior to that property noted it...
Private Const bHideContentViewMenuItem As Boolean = False 'Default: False. On the View Menu, 'Contents' doesn't work all that great. You may want to hide it.

If 'This PC' is giving more trouble than Desktop as a root... I definitely need to look at that because I've had *a lot* more problems with Desktop as root because there's numerous ways to represent it, it's also a folder in C:\Users\[name]\Desktop, and different interfaces and APIs treat those different, some think they're the same, some don't, and a lot of other things. Sometimes you ask for the Desktop's parent you get nothing or the Desktop again, sometimes you get the UserFolder.

Do the synchronization issues persist when it's root in both of them? I'll admit I've never thoroughly tested using that option with both controls combined. 

Changing the root at runtime was not a feature I had ever really tested, since it seemed like a really low priority (not sure why one would do that), so I threw in a basic 'set the variable and refresh'... if it's not working I can take a look; can it change to non-special roots ok? 


Stability problems are unfortunately a fact of life trying to combine the Windows shell and nearly quarter century old VB6 (truly ancient in computer terms)... even Microsoft's option isn't any better, their IExplorerBrowser and INamespaceTreeControl objects are also highly crash prone and have features not working right or at all when used in VB6. So at least I'm in good company not getting it all right lol

But also a lot of these issues are solvable too... these are incredibly complex projects with a 50k LOC codebase between the two and I'm just one guy working on it in his spare time. I do want to get everything working, but I just don't have the time for extensive testing across multiple platforms, or really more than a few hours a week for development right now. And while there's a few people here who know VB6 and programming a lot better than me (in some cases by a lot, have you seen some of The_trick's stuff? Damn), I do seem to be alone in Windows shell developers still interested.

The point of these examples is largely two things; to do things purely in VB6, and to go into all the advanced things you don't find in available shell controls but do in Explorer. If you're looking for stable, basic file browsing, I'd be remiss if I didn't suggest ones written by more professional developers in other languages. There's a lot more than the two you mentioned in the other thread. Timo has a good one that's free and open source, controls written in C++ but meant for VB6 with samples provided (one of the benefits there is he's got subitem controls working, a feat I've been trying to accomplish on and off for years in VB6... This PC would probably be a lot more stable without needing to hand-draw the bars, to say nothing of Programs & Features and the hyperlink columns (fair warning there, change the bDisableHyperlinkItems to True right now if you're worried about stability but want to display certain non-default columns in that location, that's horrifically unstable).

----------


## dmrvb

The ComputerasRoot is really not a significant issue, I was just exploring the options. The change at runtime is because I usually set most properties from code rather that in the design time properties window as this makes the code more self-documenting. 

The most important thing is please don't feel pressurised by me to fix the bugs, none of this is urgent or vital, but if you are happy to work on this then I am very happy to spend time testing, though I only have Win10 machines here now as all my software users are win10 (I have given up on the one still using XP).

Software is only part time for me but I have quite a bit of VB6 code that I will need to support and enhance for a few more years. I am using the LogicNP browser/tree which is no longer supported and I feel vulnerable to a Win10 update maybe breaking it, an update has already broken one of its features. I was looking at other potential ShellBrowsers as a contingency but yours is much more interesting and I would like to use it. Its written in VB6, source code available, and can be compiled directly into my code which are big advantages. A longer term goal would be to understand your code sufficiently to fix or enhance it myself, but I do try to use VB as a high level language so am not skilled at the low level Windows interface things. I believe that VB6 is a powerful language and with enough effort can do most things which is another reason that I like this project . I am also keeping a very close eye on twinBasic which could be a new VB without most of the VB limitations/oddities, but its GUI is still at an early stage. 
I hope that it can make some things, like subclassing, a whole lot easier.

Except for the crash in ThisPC I am finding your code reliable.

----------


## fafalone

Oh I definitely still want to work on it, so by all means keep the bug reports coming. But some of the issues might wind up falling under unfixable or 'Fix on this Windows version breaks that Windows version' or some of these weird memory issues might take forever to run down, since I have limited time for messing around with VB6 and have other projects to work on too (example: I'm taking this idea one step further and building an Explorer replacement by having an app that uses these controls and then behaves as a shell window, my new obsession ever since working to figure out how to take over when apps like web browsers have a 'Show in Explorer' option).

If you're looking to understand the codebase better, one thing that would certainly help is to go through all the individual shell project demos-- one of the original goals of this project was showing what you could do with everything I've written over the years. It's a lot easier when you have projects isolating a single feature... like how the previews are done with IPreviewHandler, enumerating file properties, or searching with ICondition and ISearchFolderItemFactory. You can use this link to see all my Code Bank submissions, you'll find a lot of ucShellBrowse is based on or directly copied/pasted from many of those. Sorry the code is so hard to read... between wanting everything to be in one module and my... lack of patience for best practices around formatting, naming conventions, and the like, it's definitely not the easiest to follow. 

If you're looking for even more basic understanding, 'Visual Basic Shell Programming' by JP Hamilton and 'Advanced Visual Basic 6' by Matthew Curland are great books to read for understanding working with COM interfaces, vtables, and memory pointers, and some shell programming basics (PM me if you need copies). 

Thinking VB6 can do almost anything for the type of app it's designed for is my philosophy too, I thoroughly enjoy getting all these modern shell things working in a language MS has tried it's hardest to kill after replacing it with a language inferior for many reasons for the core purpose of VB.

----------


## dmrvb

Thanks,
A bit of a philosophical ramble..... 
Advanced VB6 is available on Amazon, though just a little expensive.
I would like to know more about how VB works but this is out of curiosity and "because I should". I really want to use VB as a high level language rather than doing lots of low level stuff. In the past I have done assembler on micros and even machine code on a mini computer, plus some hardware design and interfacing, and this taught me that programming should be done at a high level except when low level is essential.
VB6 is a still a good and productive high level language, and with a bit of modernisation could be really good. I am keeping a very close eye on twinBasic.
In an ideal community we should all mostly do high level stuff except for a few experts like yourself who do the difficult bits and wrap them in an easy to use high level interface. Its not productive for us all to acquire these skills, though I did really enjoy getting the CoreAudio Device Topology API thing to work.
When I look at the code that you and Krool etc are producing my heart sinks, "why should anybody have to spend so much time and effort writing such difficult stuff". Windows really needs a complete re-write (by engineers rather than computer scientists???) but I suppose this is exactly what they did but they made .NET rather than re-doing COM.

When I look at your code I do keep thinking would it be easier to abandon the Microsoft stuff and write completely new TreeView and ListView controls including self drawn graphics? GDI can be very fast and flexible. If TwinBasic succeeds and becomes the cross platform future of VB then self drawn self contained controls would be an easier route to cross platform, and without limitations.

----------


## fafalone

> When I look at your code I do keep thinking would it be easier to abandon the Microsoft stuff and write completely new TreeView and ListView controls including self drawn graphics?


Replicating all the same features would a massive project all on it's own. Especially to have good graphics instead of basic flat stuff, although with Windows 10 there's not much more now. If you were going to do something like that, you wouldn't do it for a single small project, you'd want something that can be dropped into other projects... so now you're talking about essentially replicating it. Just think about all there is to worry about... scroll bars, footer bars, resizing, redoing a header where you do header drag/drop, supporting all the different item properties like bolded, grayed, etc... managing arbitrary icon sizes and scaling/spacing everything properly... besides, the it's not the ListView and TreeView themselves that are really the source of instability; just inconsistency with some features. You're probably going to wind up using graphics APIs that change too, so will you reimplement them? Then you're talking about hardware issues. The real problems come with interfacing with Windows itself.

But, somebody's got to write the hard stuff no matter what language you're talking about. None of the other shell browsing components that worked in VB6 have a lot of these features (and the property viewing/editing system appears unrivaled even in full on Explorer replacements being sold for real money), and none were *written* in VB6... unfortunately it's just the latter part has some real stability issues at the intersection of doing low(er) level stuff in a high level language not updated since last millennium. For the features I wanted, low level *was* essential... ListViews/TreeViews created with CreateWindowEx for instance can do a lot of stuff that's impossible or even more horrifically unstable with the VB common controls ocx. So, me and Krool didn't go that way just for fun  :Smilie:

----------


## dmrvb

There is a bit of random behaviour when inserting and removing a USB disk drives whilst displaying ThisPC.
Again I am using linked ShellBrowse and shellTree controls.
First insertion and removal usually works, but on subsequent insertions the new drive is displayed but does not remove when the drive is removed. It is this possible to get several instances of the same drive displayed.
Refreshing ShellBrowse fixes ShellBrowse but this is not ideal.
Can also get the ThisPC crash.
Returning to an earlier post, "ComputerasRoot" is of limited use because it gives no access to Network drives.

----------


## fafalone

Sounds like another Windows 10 issue; I had gotten removal to work ok in 7. 

The problem is when a drive is inserted/removed, Windows spams you with various notifications. 

Here's what an insert looks like:


```
ST][2022-02-15 13:51:17] Got PortableDevice(0)=\\?\swd#wpdbusenum#{0c2e5e43-66ce-11ec-83d1-806e6f6e6963}#0000000000100000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
[ST][2022-02-15 13:51:17] HandleShellNotify::code=SHCNE_DRIVEADD,itm1=Q:\,itm2=
[ST][2022-02-15 13:51:17] HandleShellNotify::code=SHCNE_DRIVEADD,itm1=Q:\,itm2=
[ST][2022-02-15 13:51:17] Got PortableDevice(1)=\\?\swd#wpdbusenum#{fec98b6a-665d-11ec-83d7-d8bbc1516695}#0000000000100000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
[ST][2022-02-15 13:51:17] Got PortableDevice(2)=\\?\swd#wpdbusenum#{b74926b2-665b-11ec-83d6-d8bbc1516695}#0000000000100000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
[ST][2022-02-15 13:51:17] Got PortableDevice(3)=\\?\swd#wpdbusenum#{b74926ce-665b-11ec-83d6-d8bbc1516695}#0000000008100000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
[ST][2022-02-15 13:51:17] HandleShellNotify::code=SHCNE_CREATE,itm1=::{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}\Provider\Microsoft.Networking.SSDP//uuid:cbba0323-d2bb-3569-b2d2-2df8571c54c1,itm2=
[ST][2022-02-15 13:51:17] HandleShellNotify::code=SHCNE_CREATE,itm1=::{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}\Provider\Microsoft.Networking.SSDP//uuid:cbba0323-d2bb-3569-b2d2-2df8571c54c1,itm2=
[ST][2022-02-15 13:51:17] HandleShellNotify::code=SHCNE_CREATE,itm1=::{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}\Provider\Microsoft.Networking.SSDP//uuid:2f1d60b4-1dd2-11b2-8296-2f954411ea58,itm2=
[ST][2022-02-15 13:51:17] HandleShellNotify::code=SHCNE_CREATE,itm1=::{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}\Provider\Microsoft.Networking.SSDP//uuid:2f1d60b4-1dd2-11b2-8296-2f954411ea58,itm2=
[ST][2022-02-15 13:51:17] HandleShellNotify::code=SHCNE_MKDIR,itm1=::{289AF617-1CC3-42A6-926C-E6A863F0E3BA}\uuid:2f1d60b4-1dd2-11b2-8296-2f954411ea58,itm2=
[ST][2022-02-15 13:51:17] HandleShellNotify::code=SHCNE_MKDIR,itm1=::{289AF617-1CC3-42A6-926C-E6A863F0E3BA}\uuid:2f1d60b4-1dd2-11b2-8296-2f954411ea58,itm2=
```

Then removal:


```
[ST][2022-02-15 13:52:12] HandleShellNotify::code=SHCNE_DRIVEREMOVED,itm1=Q:\,itm2=
[ST][2022-02-15 13:52:12] HandleShellNotify::code=SHCNE_DRIVEREMOVED,itm1=Q:\,itm2=
[ST][2022-02-15 13:52:12] HandleShellNotify::code=SHCNE_UPDATEDIR,itm1=C:\Users\Jon\Desktop,itm2=
[ST][2022-02-15 13:52:12] Got PortableDevice(0)=\\?\swd#wpdbusenum#{fec98b6a-665d-11ec-83d7-d8bbc1516695}#0000000000100000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
[ST][2022-02-15 13:52:12] Got PortableDevice(1)=\\?\swd#wpdbusenum#{b74926b2-665b-11ec-83d6-d8bbc1516695}#0000000000100000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
[ST][2022-02-15 13:52:12] Got PortableDevice(2)=\\?\swd#wpdbusenum#{b74926ce-665b-11ec-83d6-d8bbc1516695}#0000000008100000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
[ST][2022-02-15 13:52:12] HandleShellNotify::code=SHCNE_DRIVEREMOVED,itm1=::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\swd#wpdbusenum#{0c2e5e43-66ce-11ec-83d1-806e6f6e6963}#0000000000100000#{6ac27878-a6fa-4155-ba85-f98f491d4f33},itm2=
[ST][2022-02-15 13:52:12] HandleShellNotify::code=SHCNE_DRIVEREMOVED,itm1=::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\swd#wpdbusenum#{0c2e5e43-66ce-11ec-83d1-806e6f6e6963}#0000000000100000#{6ac27878-a6fa-4155-ba85-f98f491d4f33},itm2=
[ST][2022-02-15 13:52:12] HandleShellNotify::code=SHCNE_MKDIR,itm1=::{289AF617-1CC3-42A6-926C-E6A863F0E3BA}\uuid:2f1d60b4-1dd2-11b2-8296-2f954411ea58,itm2=
[ST][2022-02-15 13:52:12] HandleShellNotify::code=SHCNE_MKDIR,itm1=::{289AF617-1CC3-42A6-926C-E6A863F0E3BA}\uuid:2f1d60b4-1dd2-11b2-8296-2f954411ea58,itm2=
```

And the sequence changes from version to version or sometimes even just randomly. If it sends more adds than removes, you might wind up with duplicates.

Needless to say, getting spammed with random numbers of duplicates of the same notification is difficult to handle consistently. Especially when it mixes in referring to the drive as letter and a GUID. 

I *think* the problem here might be Windows 10 is trying to deliberately throw things off... look how it sent two MKDIR (Directory Created) messages saying a GUID referring to the device had been created, after the removal routine. I don't know where that behavior started but you don't expect to get a message to recreate a removed drive.

Can think of a couple fixes... adding a timed lockout would be the easiest... but might get messed up if the system is lagging or you remove multiple drives at the same time. So I think I'll try ignoring MKDIR messages for devices, since the DRIVEADD or UPDATEDIR messages will take care of creating them; or perhaps an aggressive dupe check in LVAddEntry.

----------


## fafalone

*Project Update: 11.2*
-I haven't had a ton of time to work on this between work and so many other projects, but I did want to release the few small feature updates and bug fixes that have been pending.



```
'New in v11.2 (Released 18 Jun 2022)
'
'-Added SearchAutoGroup to automatically group search results. The default is to
' group them by folder, but you can change that via the szAutoGroupSearchCat
' User Option.
'
'-In addition to below specific bug identified, added a more robust system of
' ensuring duplicates are not added by receiving duplicate ShellNotify messages.
'
'-SelectedFiles (Let) and FileSetCheck are no longer case sensitive.
'
'-Now use Unicode-aware width calculations in Details Pane.
'
'-(Bug fix) In Computer/This PC, for some Windows versions removing a USB device
'           then plugging it back in could result in duplicate entries.
'           Also improved entry remover to better handle these.
'
'-(Bug fix) SelectedFileSet ignored bDeselectOthers flag.
'
'-(Bug fix) The control improperly reported the Windows version due to Microsoft
'           breaking most version functions to require a manifest specifying 10
'           compatibility or else it deliberately reports Windows 8. This didn't
'           impact functionality as the only version-restricted features were
'           Vista+ to run at all, and Windows 8+ for some Bookmarks folders.
'
'-(Bug fix) Since version 9.4, pressing enter in the Search Box accidentally
'           had the code to use the legacy search enabled. That would be conducted
'           first, then the new search would be conducted. This doubled (at least)
'           the search time and created a duplicate folder.
'
'-(Demo)    The Demo manifest, with the preferred settings, has been updated to
'           include compatibility flags, trust info, and newer dpi awareness.
```

----------

