-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
I meant was developing XP-compatible projects wasn't really my thing. Of course I'll send you Brad's projects.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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).
Code:
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.
Code:
'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.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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:
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:
Code:
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
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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:
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:
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.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.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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:
Code:
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.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
Quote:
Originally Posted by
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:
Code:
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.
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:
Code:
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):
Code:
ucShellBrowse1.BrowserPath = "C:\MyFiles\MyVids\Music\Classical-Music"
ucShellBrowse1.ItemFilter = "T*.*"
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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
Code:
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:
Code:
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
Code:
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.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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:
Code:
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:
Code:
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:
Code:
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:
Code:
-->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:
Quote:
Originally Posted by
fafalone
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?
Code:
picturebox.Cls
hBitmapToPictureBox picturebox, hBmp
picturebox.Refresh
(Don't forget the DeleteObject call when you're done with the hbitmap as well.)
And cx and cy are width/height. You definitely don't want a 0x0 image. Gotta change that picturebox scalemode to vbPixels if you're using picturebox.width/height as the size too, or you'll get a giant image.
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
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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?
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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:
Code:
'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.
-
1 Attachment(s)
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
Version 6.3 Released!
Attachment 180802
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:
Code:
'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.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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:
Code:
'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.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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:
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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
Code:
'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.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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.
https://i.imgur.com/IaK4DjU.jpg
MP3 album art
Full Changelog
Code:
'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)
-
1 Attachment(s)
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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
Code:
'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:
Attachment 180803
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:
Code:
End If
End Property
Replace those two lines with these:
Code:
Else
m_sCurPath = sNewPath
End If
PropertyChanged "BrowserPath"
End Property
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
Version 7.0 Released!
http://www.vbforums.com/images/ieimages/2017/10/1.jpg
Progress marquee while loading folders
http://www.vbforums.com/images/ieimages/2017/10/1.jpg
Custom columns with images
http://www.vbforums.com/images/ieimages/2017/10/1.jpg
Custom root
http://www.vbforums.com/images/ieimages/2017/10/1.jpg
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:
Code:
'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.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
good job.
everything works well
Greetings
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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)
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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.
Code:
'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.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
This is an impressive piece of work. I could really do with the same filelistbox control in VB.NET.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
Thanks :afrog:
Always found shell programming interesting, so creating a full-blown Explorer-type control was always inevitable :D
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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:
Code:
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:
Code:
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:
Code:
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:
Code:
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.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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.
Code:
'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.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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.
http://www.vbforums.com/images/ieimages/2017/10/1.jpg
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
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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?
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
God damn Windows 10 :(
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 :D
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:
Code:
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
Code:
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)
Code:
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
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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.
https://i.imgur.com/xawATH5.jpg
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
What kind of file browser couldn't be achieved in VB6?
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
That graphical one above... I'm sure it could but my experience in trying to skin VB6 apps has been off-putting.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
Quote:
Originally Posted by
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.
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:
http://vbRichClient.com/Downloads/RocketDock.png
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
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
Quote:
Originally Posted by
Schmidt
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...
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
Quote:
Originally Posted by
yereverluvinuncleber
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
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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:
Code:
'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.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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.
Code:
'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 :eek2::sick::cry::confused:
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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).
Code:
'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:
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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?
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
Quote:
Originally Posted by
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?
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 =/
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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.
-
2 Attachment(s)
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
Quote:
Originally Posted by
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.
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.
Attachment 176741
Attachment 176743
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
Quote:
Originally Posted by
fafalone
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:
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
Quote:
Originally Posted by
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.
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.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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)
Code:
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
Code:
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
https://i.imgur.com/eYSBA4z.jpg
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
Quote:
Originally Posted by
fafalone
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.
-
1 Attachment(s)
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
Released v8.2 Final since no major issues popped up. Included a couple small fixes, including the previewer, and the change requested by MountainMan.
Code:
'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!):
Attachment 178400
Full Changelog:
Code:
'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.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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.
Code:
'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.
-
Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature
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.
Code:
'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.