Page 2 of 7 FirstFirst 12345 ... LastLast
Results 41 to 80 of 253

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

  1. #41
    Fanatic Member
    Join Date
    Mar 2010
    Posts
    762

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

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

    Unlike ucShellBrowse, in Windows Explorer, the following hot-keys are available:
    1. Alt+D: Moves focus to the addressbar and highlights it.
    2. Alt+LeftArrow: Navigates to the previous folder (invokes the "Back" button).
    3. Alt+RightArrow: Navigates to the Next folder (invokes the "Forward" button).
    4. Alt+UpArrow: Navigates to the parent folder (invokes the "Up" button).

    But in ucShellBrowse, in my tests I can't make those four actions possible via keyboard.
    Please note that any of the above 4 actions could be desirable in any of the following two scenarios:
    1. The focus is on a specific file (the user has clicked and highlighted a file thumbnail in ucShellBrowse)
    Now, the user wishes to use those above-mentioned hot-keys to invoke those functions.
    2. The focus is somewhere else on the form, and the user wishes to use those above-mentioned hot-keys to invoke those functions.
    For example, let's say the user is typing something in a textbox completely outside the ucShellBrowse (below screen print):
    https://i.imgur.com/TJfpRs0.jpg
    And while typing in there, the user wishes to to use those above-mentioned hot-keys to invoke those functions.

    Is that possible?
    How can I program ucShellbrowse to make that possible?

    Thanks.
    Ilia

  2. #42

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

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

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

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

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

    PS- The Backspace key is an existing shortcut for open parent.
    Last edited by fafalone; Mar 8th, 2019 at 07:35 PM.

  3. #43

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

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

    Version 5.3 Released!
    Jump to download

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

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

    The pic on the right shows the new History Menu where you can navigate all the forward/backward locations; right-click either one of the fwd/back buttons (when enabled) to show it. Also, these buttons aren't just static images, they show all available states-- disabled when there's nowhere to go, the normal state in the pics above, a 'hot' state when the mouse is over them, and a 'pressed' state while being clicked.
    And since the buttons are drawn with the Theme API rather than stored as static images, you'll see buttons consistent with your Windows version. Here's the control running on Win10, with one of the buttons in the 'hot' state because the mouse is over it:



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

  4. #44
    Fanatic Member
    Join Date
    Mar 2010
    Posts
    762

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

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

    1. The new property "SetFocusOnFile" almost doesn't work.
    I have this code:
    Code:
    Private Sub ucShellBrowse1_FileExecute(ByVal sFile As String, siFile As oleexp.IShellItem)
       Call cmdFileProcess_Click
    End Sub
    
    Private Sub cmdFileProcess_Click()
       MsgBox "Selected item:  " & ucShellBrowse1.SelectedFile, vbOKOnly, "Process"
       ucShellBrowse1.SetFocusOnFiles
    End Sub
    I select a file, and use the arrow keys to move and select another file. Therefore the selected file appears to be highlighted (it will have a light blue rim).
    Then I press Carriage Return. Therefore the above messagebox appears. (and the file's rim changes to gray).
    Then I click on the "Ok" button on the messagebox.
    Then the selected file's rim will change back to light blue, giving me the APPEARANCE that that file has focus again.
    But, it doesn't really have focus, because then I press the right arrow key to move to the next file, and at that point, it doesn't move to the next file. Instead, some other control on the form (a textbox below the ucShellBrowse) gets focus! And I can type in that textbox.

    2. The Back and Forward buttons have a problem.
    I have this code:
    Code:
    Private Sub Form_Load()
       Me.Show
       DoEvents
       ucShellBrowse1.Visible = False
       
       ucShellBrowse1.ViewMode = SB_VIEW_THUMBNAIL
       ucShellBrowse1.FileDragDropMode = SBDD_Disabled
       
       ucShellBrowse1.BrowserPath = "C:\MyFiles\MyVids\Music\Classical-Music"
       
       ucShellBrowse1.Visible = True
       
    End Sub
    The form loads properly.
    Then I navigate to the this folder: C:\MyFiles\MyVids\Music which is the parent folder.
    The navigation happens fine. ucShellBrowse shows the contents of the parent folder.
    Then I click on the "Back" button.
    At this point, ucShellBrowse goes to the wrong folder. It mistakenly goes to C:\Dev\VB6\FS2. This is my vbp project folder.
    It looks like ucShellBrowse THINKS that the previous folder is the vbp project folder.

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

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

    Please advise.
    Thanks.

  5. #45

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

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

    1) I'll have to make a post about this in the main forum. I can't find any way to set keyboard focus back; even sending LBUTTONDOWN/LBUTTONUP isn't working-- restores the black focus rectangle, but then still arrow keys navigate to another control. Very weird.
    Update: Fixed
    Another control was somehow stealing the focus, the solution is to add a timer before the SetFocus call. I'll update the project shortly, if you want to add it to the current version without waiting, here's what you do:
    a) Add the following module-level declares,
    Code:
    Private Declare Function SetTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
    Private Declare Function KillTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long) As Long
    Private mTmrProc As Long
    b) At the bottom of the control code where all the subclassing procedures are, add the following above FWWndProc as ordinal #11,
    Code:
    '@11
    Private Sub FocusTimerProc(ByVal hWnd As Long, ByVal uMsg As Long, ByVal TimerID As Long, ByVal Tick As Long)
        KillTimer hWnd, TimerID
        If hWnd = hLVS Then DoSetFocus
        If hWnd = hCombo Then DoCBFocus
    End Sub
    c) Delete the existing SetFocusOnFiles/SetFocusOnDropdown subs and replace them with this,
    Code:
    Public Sub SetFocusOnFiles()
    If mTmrProc = 0& Then mTmrProc = scb_SetCallbackAddr(4, 11, , , True)
    SetTimer hLVS, WM_USER + 99, 10, mTmrProc
    End Sub
    Private Sub DoSetFocus()
    DoEvents
    SetFocus hLVS
    End Sub
    Public Sub SetFocusOnDropdown()
    If mTmrProc = 0& Then mTmrProc = scb_SetCallbackAddr(4, 11, , , True)
    SetTimer hCombo, WM_USER + 98, 10, mTmrProc
    End Sub
    Private Sub DoCBFocus()
    DoEvents
    SetFocus hCombo
    End Sub
    2) The initial path is your project folder; so it looks like the first .BrowserPath call isn't being added to the history list possibly.
    That might be causing an issue with the forward button too; what does the history menu look like? (right click the button)
    It works normally for me so I'll have to try to recreate the issue; will take a look tomorrow.

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


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

  6. #46
    Fanatic Member
    Join Date
    Mar 2010
    Posts
    762

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

    Quote Originally Posted by fafalone View Post
    1) I'll have to make a post about this in the main forum. I can't find any way to set keyboard focus back; even sending LBUTTONDOWN/LBUTTONUP isn't working-- restores the black focus rectangle, but then still arrow keys navigate to another control. Very weird.
    Update: Fixed
    Another control was somehow stealing the focus, the solution is to add a timer before the SetFocus call. I'll update the project shortly, if you want to add it to the current version without waiting, here's what you do:
    a) Add the following module-level declares,
    ...
    b) At the bottom of the control code where all the subclassing procedures are, add the following above FWWndProc as ordinal #11,

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

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

    Sorry for not catching these before release. There's a couple other issues I want to fix before updating, which I'll do tomorrow or the day after. I'm also adding a built-in search-- it already supports custom file sets, so it's just natural to go ahead and add in a Search Box like Explorer:
    Thanks a lot for the response.
    And thanks for this great control (ucShellBrowse). It is really a good one.

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

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

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

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

    Thanks again for this great control.

    Ilia

  7. #47

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

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

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

    Can you give me an idea of what you were doing before these errors were triggered? In the IDE, compiled exe, or both? If I can find a way to reproduce them I can track it back to which change caused the issue.
    Last edited by fafalone; Mar 19th, 2019 at 08:38 AM.

  8. #48
    Fanatic Member
    Join Date
    Mar 2010
    Posts
    762

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

    Quote Originally Posted by fafalone View Post
    I've never encountered these error before; according to MSDN the first one is "Invalid window handle"

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

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

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

    And here is the entire code behind this form:

    Code:
    Option Explicit
    
    
    Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
       
       Dim CombinedKey            As String
       
       CombinedKey = "" & KeyCode & "-" & Shift
       
       
       'Main: User's keyboard command processing
       Select Case CombinedKey
          Case "38-4"                               ' Alt+UpArrow
             txtItemId.Text = "Alt+UpArrow :: " & CombinedKey
             KeyCode = 0
             Shift = 0
          Case "37-4"                               ' Alt+LeftArrow
             txtItemId.Text = "Alt+LeftArrow :: " & CombinedKey
             KeyCode = 0
             Shift = 0
          Case "39-4"                               ' Alt+RightArrow
             txtItemId.Text = "Alt+RightArrow :: " & CombinedKey
             KeyCode = 0
             Shift = 0
          Case Else
             Exit Sub
       End Select
       
    End Sub
    
    Private Sub Form_Load()
       Me.Show
       DoEvents
       ucShellBrowse1.Visible = False
       
       ucShellBrowse1.ViewMode = SB_VIEW_THUMBNAIL
       ucShellBrowse1.FileDragDropMode = SBDD_Disabled
       
       ucShellBrowse1.BrowserPath = "C:\MyFiles\MyVids\Music\Classical-Music"
       
       ucShellBrowse1.Visible = True
       
    End Sub
    
    Private Sub ucShellBrowse1_DirectoryChanged(ByVal sFullPath As String, siItem As oleexp.IShellItem)
       lblMessage.Caption = ""
    End Sub
    
    Private Sub ucShellBrowse1_FileExecute(ByVal sFile As String, siFile As oleexp.IShellItem)
       Call cmdFileProcess_Click
    End Sub
    
    Private Sub cmdFileProcess_Click()
       MsgBox "Selected item:  " & ucShellBrowse1.SelectedFile, vbOKOnly, "Process"
       ucShellBrowse1.SetFocusOnFiles
    End Sub
    
    Private Sub ucShellBrowse1_PreDirectoryChange(ByVal sFullPath As String, fCancel As Long)
       lblMessage.Caption = "Please wait ... "
       Me.Refresh
    End Sub
    
    Private Sub ucShellBrowse1_SelectionChanged(arFullPaths() As String, sFocusedItem As String, siFocused As oleexp.IShellItem)
       If UBound(arFullPaths) - LBound(arFullPaths) + 1 = 0 Then
          txtFileSelected.Text = ""
       Else
          txtFileSelected.Text = arFullPaths(0)
       End If
    End Sub
    And one other (very strange thing that just happened a few minutes ago:

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

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

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

  9. #49
    Fanatic Member
    Join Date
    Mar 2010
    Posts
    762

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

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

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

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

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

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

    Please help.
    Thanks.
    Ilia

  10. #50

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

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

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


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



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

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

  11. #51
    Fanatic Member
    Join Date
    Mar 2010
    Posts
    762

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

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

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

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

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

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

    Thanks.

  12. #52

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

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

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

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


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


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

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

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

    4) Double-click prjTest003.vbp

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

    Try to run that new exe, and post the results in this thread I first linked to above so a few other people can see it.
    Last edited by fafalone; Apr 15th, 2019 at 06:42 PM.

  13. #53

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

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

    I'm attaching the most recent version of this control down here... there's some serious bugs that have been corrected, but a major navigation bug is looking like an even longer term fix since Windows 10 has profoundly broken a few APIs for getting shell items when navigating certain virtual locations-- e.g. phones and cameras. It's basically a crapshoot which API will work on which path, so I'm going to have to re-do a lot of stuff and create a whole bunch of fallback options for every navigation action.
    Basic straight-in navigation is working; but forward, back, up, and refresh are extremely iffy; they may or may not work. So that's an important fix compared to it not working at all. Shell notify should mostly work; in any case there won't be incorrect notifies (I think, at least on my Win10 version).
    Then there's several other bugs and the addition of an optional search box (off by default, but added a button in the demo). So now that it's feature complete, I wanted to put an interim update out for everyone before updating the master version, in case there's any other last minute bugs while I'm fixing the navigation. Also, there was an issue with compiling the manifest file from the demo project in Win10 that caused exe's to not run, because the text wasn't padded to 4 bytes. That's fixed now. Use the resource file from this version always; there's a couple graphics updates too.
    Only the first demo will be included in this release.
    Code:
    '-Added an optional Search Box to the control box. You can type in a search string,
    ' press enter, and it will search the current folder and its subfolders, then use
    ' the Custom File Set functionality to display the results.
    ' Note: Running a search will replace any existing custom file set you previously
    '       loaded; search counts as custom and currently only one custom is supported.
    '
    '-Main control border styles now include non-standard Thick/Thicker (resizable)
    ' options like the ListView border styles. These will only show during runtime.
    '
    '-(Bug fix) SetFocusOnFiles/SetFocusOnDropdown were having focus invisibly taken
    '           by something; all visual indicators showed proper focus but keypress
    '           would move focus to other controls. Fixed by setting an API timer to
    '           execute the focus change after a 10ms delay.
    '
    '-(Bug fix) When using the control with another ucShellBrowse control or with a
    '           ucShellTree control, an external variable had to be used to prevent
    '           an infinite loop of directory change notifications and reloading; this
    '           was due to a failure to implement a sanity check in .BrowserPath to
    '           not proceed if NewPath=CurrentPath.
    '
    '-(Bug fix) A debug call on ShowShellContextMenu that shouldn't have had any effect
    '           was actually causing a number of problems with icons and submenus.
    '
    '-(Bug fix) When compiled with the manifest from the included resource files on
    '           certain versions of Windows 10, the exe would not run because the
    '           manifest file was not a multiple of 4 bytes.
    '
    '-(Bug fix) On Windows 10, navigation into certain virtual objects was limited to
    ' (Partial) the first level due to different behavior of some shell interfaces,
    '           a workaround was added by storing certain pidls at module level.
    '           Back, forward, up, refresh, and history are all still in progress
    '           and may or may not work depending on factors I haven't entirely
    '           figured out yet; it's going to take a while.
    '
    '-(Control) Manually destroyed additional API windows and freed resources in the
    '           Terminate event in an effort to prevent memory leakage.
    Update (Rev1) - Error in StartNotifyOnCurPath fixed

    UPDATE: File removed. Final version of 6.0 has been released, download it up top..
    Last edited by fafalone; May 19th, 2019 at 02:13 AM.

  14. #54
    Hyperactive Member
    Join Date
    Jun 2016
    Location
    España
    Posts
    506

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

    hello good I found an error in StartNotifyOnCurPath
    next without for

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

  15. #55

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

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

    Fixed.

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

  16. #56
    Fanatic Member
    Join Date
    Mar 2010
    Posts
    762

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

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

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

    Some notes and thoughts:

    1- the Res file in the new UCSB6-RC2-Rev1.zip file is named resImagesStd6.RES with the version number (6) being part of the file name.
    I think it would be probably better if the file names always remained the same, so that with any release, the new version of each file would simply overwrite and replace the older version.
    With this new Res file in this new UCSB6-RC2-Rev1.zip package, I actually removed the existing Res file from my vbp project, and added the new Res file.
    It would be better if the file names were the same so that an overwrite would simply replace.
    On the other hand, I understand that this was probably a temporary release to see if the issues are fixed or not, and that you probably yourself were going to have fixed file names in the main release.
    So, my point in here may be unnecessary.
    However, it doesn't hurt to say it anyway.

    2. The first post in the main thread still has the ucShellBrowse53.zip (released march 09, 2019) and that could cause some confusion for somebody who comes across ucShellBrowse for the first time.
    But, again, as I said, this UCSB6-RC2-Rev1.zip may just be a temporary release, and in that case my comment on this matter too may be unnecessary.

    3. In my own notes I had specified two things to do with each new release of ucShellBrowse:
    Change this: Private Const dbg_PrintToImmediate As Boolean = True -- Change it to False to stop debug printing
    Set the 'BackButton' property to 2-SBBK_ThemeButton.
    With this new UCSB6-RC2-Rev1.zip I easily did the first task before any testing.
    But, the second task I don't know how to do, because ucShellBrowse now has different looks at design mode in VB6 IDE, so, how can I change that property of the BackButton?
    Not very important. Just curious as to how to do this. If it is not possible, then it doesn't matter.

    4. It is a while that those two strange errors don't happen any longer (A. Out of memory error and B. Unhandled window error), so, it is a good thing.

    5. It is a very good thing that we have this in the code:
    Code:
    Option Explicit
    Private Const mVersionStr = "ucShellBrowse 6.0.1-RC2"
    Private Type HistPidl
        sPath As String
        pidlFQ As Long
    End Type
    So, at first glance, the developer can easily make sure that he has the latest version.

    Thanks for everything.
    Ilia
    Last edited by IliaPreston; May 4th, 2019 at 07:55 PM.

  17. #57

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

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

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

    2) Finalizing it now, should update tonight.

    3) It's always a good idea to read the release notes when there's an update like that, I write all that for a reason you know
    Quote Originally Posted by Changelog
    Code:
    'New in v5.3 (Released 08 Mar 2019)
    '-There is now a Forward button in addition to the Back button. The 'BackButton'
    ' option has been replaced with the 'NavigationButtons' option, which provides the
    ' same options; hidden, standard buttons, or themed buttons.
    ' Additionally, right-clicking either of the buttons will display the history as a
    ' menu where you can pick any item to navigate to (current location is in bold).
    '
    '-The themed back (and now forward) button now have the option to be placed in the
    ' control box immediately to the right of the combo.
    4) Good news, though I'm not sure what I did that fixed it, unless maybe it was after running and exiting a few times and the new cleanup routines got it.

    5) You can always check that at runtime as well, Ctrl+Shift+P on the ListView displays that, as well as whether ComCtl6 is enabled, the DPI-scaling factor, and a couple other data points.
    Last edited by fafalone; May 18th, 2019 at 08:00 PM.

  18. #58
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

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

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

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

  19. #59

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

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

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

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


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

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

  20. #60
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

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

    Quote Originally Posted by fafalone View Post
    My project is a new generation of previous shell browsers, such as Brad Martinez's VBExplorer/EnumDeskVB,

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

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

  21. #61

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

    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.

  22. #62
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    261

    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.

  23. #63

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

    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.
    Last edited by fafalone; May 23rd, 2019 at 08:53 PM.

  24. #64
    Fanatic Member
    Join Date
    Mar 2010
    Posts
    762

    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

  25. #65
    Fanatic Member
    Join Date
    Mar 2010
    Posts
    762

    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.

  26. #66

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

    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.
    Last edited by fafalone; May 29th, 2019 at 06:50 PM.

  27. #67
    Fanatic Member
    Join Date
    Mar 2010
    Posts
    762

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

    Quote Originally Posted by fafalone View Post
    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*.*"

  28. #68

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

    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.
    Last edited by fafalone; Jun 4th, 2019 at 11:53 PM.

  29. #69
    Fanatic Member
    Join Date
    Mar 2010
    Posts
    762

    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 View Post
    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

  30. #70

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

    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?
    Last edited by fafalone; Jun 23rd, 2019 at 08:08 PM.

  31. #71

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

    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.

  32. #72

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

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

    Version 6.3 Released!

    Name:  ucsb2-17.jpg
Views: 435
Size:  29.8 KB


    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.
    Last edited by fafalone; Mar 26th, 2021 at 05:25 AM.

  33. #73

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

    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.

  34. #74

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

    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.

  35. #75

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

    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.

  36. #76

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

    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.


    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)

  37. #77

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

    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:
    Name:  ucsb-4.jpg
Views: 506
Size:  77.7 KB
    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
    Last edited by fafalone; Mar 26th, 2021 at 05:27 AM.

  38. #78

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

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

    Version 7.0 Released!

    Progress marquee while loading folders


    Custom columns with images


    Custom root


    Hyperlinks

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

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

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

    Here's the full changelog:
    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.
    Last edited by fafalone; Feb 21st, 2020 at 03:16 AM. Reason: New Version

  39. #79
    Hyperactive Member
    Join Date
    Jun 2016
    Location
    España
    Posts
    506

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

    good job.
    everything works well

    Greetings

  40. #80

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

    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)
    Last edited by fafalone; Mar 5th, 2020 at 02:06 AM.

Page 2 of 7 FirstFirst 12345 ... LastLast

Tags for this Thread

Posting Permissions

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



Click Here to Expand Forum to Full Width