Page 5 of 5 FirstFirst ... 2345
Results 161 to 172 of 172

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

  1. #161

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

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

    Sorry about that the next version I'm working on adds that argument. I've updated the download to remove it for now, or you can just delete the siItem argument and use the commented out way of changing the shell item (that's the only change):

    Code:
    Private Sub ucShellTree1_ItemSelect(sName As String, sFullPath As String, bFolder As Boolean, hItem As Long)
    'If bStartup = False Then
        If bFolder Then
            'Previously we set by path, but this won't work with Win10 virtual devices like phones and cameras
            'ucShellTree had to be extensively modified to not navigate or set the selected ishellitem by just the path either
    '        ucShellBrowse1.BrowserPath = sFullPath
             ucShellBrowse1.BrowserOpenItem ucShellTree1.SelectedShellItem
        End If
    'End If
    End Sub

  2. #162

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

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

    Major Project Update: Version 9.5
    Originally, this was just going to be a quick fix... the black boxes for shortcut overlays still appeared in Med/L/XL icon view (when switching to a new folder in high perf mode).
    HOWEVER... I went on a crazy coding binge making yet another update so soon worth it, by tackling some long standing problems:
    -In the Details Pane, the properties boxes would routinely be placed such that property names got cut off, or it overlapped the type name, or there was an excessive gap at the bottom. The layout has been completely re-done from scratch. All columns are now the appropriate width for the properties they contain, and the next column starts where the previous one let off. There's no more issues with the file names overlapping, no more huge gaps at high DPI, everything is perfect.

    -You can now set the font for the ListView/ComboBox, and Details Pane, separate from the main font for the rest of the control, right from the Properties Window with a font dialog. If you don't set the LV/CB or DT font, it defaults to the main control font, and stays synced to that until you specifically set it to something else.
    -All the buttons/frames/textboxes now inherit the main control font, with the exception of being limited to size 9 for layout constraints.

    -There's lists for Files and Folders (selected and checked, plus full paths for each), but now there's a combined list that contains both. Items(), ItemsFullParsing(), ItemCount, ItemsSelected(), ItemsSelectedFull(),' ItemsSelectedCount, ItemsChecked(), ItemsCheckedFull(), and ItemsCheckedCount.

    A couple other small features and minor fixes round out the release. I've tried to test things thoroughly, so assuming nothing major pops up I intend to keep this version up for a while.

    Name:  ucsb95-1.jpg
Views: 100
Size:  25.1 KB
    Name:  ucsb95-2.jpg
Views: 99
Size:  8.1 KB
    Name:  ucsb95-3.jpg
Views: 95
Size:  9.1 KB
    Separate fonts and vastly improved Details Pane layout. Long properties like 'Contributing artists' had been particularly problematic.

    Code:
    'New in v9.5 (Released 18 Mar 2021)
    '
    '-Completely redid the Detail Pane property placement from scratch. Properties are
    ' no longer overlapping regardless of length, and are spaced according to their
    ' actual length so a column with short properties doesn't take up way more space
    ' then needed. The UserOption cxMaxProp specifies the maximum length of an edit
    ' box for a property, cxMinProp specifies the minimum.
    ' The file name/type display in the Details Pane also expands based on whether
    ' there's enough room to show any properties.
    '
    '-Made fonts independent of eachother. There's now FontFileControls that sets the
    ' ListView and ComboBox font, and FontDetails that sets the font for the Details
    ' Pane. Everything else is controlled by the original Font property.
    ' FontDetails and FontFileControls will default to the main font until you set them
    ' to something different.
    ' So if you're upgrading an existing project, no fonts will change, it will simply
    ' inherit the existing ones, with the exception that there's no more defaulting to
    ' a system font, so if you had DetailsPaneUseControlFont = False, it would now be
    ' the main font until you changed it.
    '
    '-Added Items(), ItemsFullParsing(), ItemCount, ItemsSelected(), ItemsSelectedFull(),
    ' ItemsSelectedCount, ItemsChecked(), ItemsCheckedFull(), and ItemsCheckedCount
    ' functions to retrieve a list of these for both files and folders instead of one
    ' or the other.
    '
    '-Added FilesCheckedCount and FoldersCheckedCount since there were counts for the
    ' full list and selected list, but not the checked list.
    '
    '-All controls on the Column Select and Search popups now inherit the main control
    ' font. Due to layout constraints, the size is limited to 9 points for now, so if
    ' the main font is larger, it will be reduced *only for these controls* (and the
    ' buttons in the Control Box); for the rest the full size is still used.
    '
    '-Added ControlBarHeight property. If you're using ListViewOffsetX to open a blank
    ' space for e.g. a ShellTree, it's helpful to know the current height of the
    ' control bar, since a larger font size will make it taller. (Get only).
    ' The ShellOpenDemo project shows this in use.
    '
    '-Final sizing wasn't applied when the control was first loaded into the IDE form
    ' designer; it now runs the full resize routine so it should better match the
    ' runtime appearance. Always check that; some things can't/won't be reflected at
    ' design time. Most notably, if it's view is Thumbnail View, that won't be applied
    ' until runtime, so the designer will show it in the last normal mode it was in.
    '
    '-(Bug fix) Changing the font during runtime resulted in the font on the Command
    '           Buttons being 'stuck'... it wouldn't fonts again until the app
    '           restarted, or if in the IDE, until the entire IDE restarted.
    '
    '-(Bug fix) If you set the Details Pane to not inherit the main font, the spacing
    '           and sizing were incorrect (and illegible). However, that option has
    '           now been removed since it can be set separately.
    '
    '-(Bug fix) The black box overlay bug was not actually fixed for MD/L/XL icon view.


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

    [VB6] Shell Controls OCX

  3. #163

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

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

    Project Update: Version 9.5 R1
    I have no idea how this was overlooked but for some reason tabbing had stopped working. Also before it stopped working, tabbing then shift-tabbing between a VB control and API control resulted in focus getting stuck.
    Also a minor bug fix; after Tile View was selected, moving to a new folder added an extra line that duplicated the file name. Also added a DetailsPaneOffsetX property, to move that over the same way as the ListView, letting you have a ShellTree etc. go further down the side--- the DemoEx sample has been updated to use this, while DemoOpenDlg continues to only offset the ListView.

    Name:  ucsb951.jpg
Views: 83
Size:  55.8 KB

    Code:
    'New in v9.5 R1 (Released 22 Mar 2021)
    '
    '-Added DetailsOffsetX property, so that you can e.g. have a ShellTree that goes
    ' all the way down to the StatusBar without also having the Details Pane under it.
    '
    '-(Bug fix) Eliminated memory leaks from unfreed font handles.
    '
    '-(Bug fix) After Tiles View is set, moving to a new directory causes there to be
    '           a 4th line that duplicates the file name.
    '
    '-(Bug fix) Tabbing had stopped working. Also, when they were working, focus would
    '           get stuck if you tabbed backwards between a VB and API control.

  4. #164

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

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

    Project Update: Version 9.5 Revision 2
    Sorry for yet another significant bug guys... the complexity is really getting out of hand for what I have time for

    The new focus system for arrows and tabs changed the way focus worked, such that if you clicked a button in the control bar (Up, View, etc) then clicked the Search Box or Combo edit box (if present and editable), enter keypresses went to the button, instead of the box, which made it impossible to search (unless you clicked another API control first, then went to search). I was able to find a workaround that fixed this without breaking the tab/arrow keys functionality.
    Also made a major performance improvement for High Perf mode; for InfoTips on folders it won't search that folder for its contents, which could take a while for large folders. and it won't lookup link targets for those properties either; also InfoTipMode wasn't being changed during runtime. Finally, added Copy Names/Full Paths to the shell context menu.

    Code:
    'New in v9.5 R2 (Released 25 Mar 2021)
    '
    '-Added Context Menu items 'Copy names' and 'Copy full paths' to copy the selected
    ' items to the clipboard.
    '
    '-Substantial delays could result from mousing over certain items like a folder
    ' containing thousands of items while the InfoTip was generated, since the code
    ' was set to go deep to generate the best tip. Using slow tips is now disabled in
    ' High Perf Mode, as is looking up link targets and using their info. This doesn't
    ' effect most items; pictures, mp3s, etc, will still show metadata... as far as I
    ' can tell this only effects showing Size/Files/Folders in Folder infotips.
    ' You can toggle this setting with the User Option bLimitInfoTipsInHighPerfMode.
    '
    '-(Bug fix) Changes to InfoTipMode were not being applied during runtime.
    '
    '-(Bug fix) The new tab/arrow key system set the focus in such in way that if you
    '           clicked on a button (View/Up/etc) then click on the Search Box or the
    '           Dropdown edit box (if present and editable), the enter key went to the
    '           last button pressed. I found a workaround to resolve that without the
    '           tab/arrow keys breaking again.

  5. #165
    Addicted Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    177

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

    ShellBrowseDemoEx compiles but will not run. It stops on line 533

    Code:
    ucShellTree1.OpenToItem siItem, False
    in Form1 with Run-time error 10: "The array is fixed or temporarily locked".

  6. #166

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

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

    Uncomment the bChanging check/toggle in ucShellBrowse1_DirectoryChanged and Form_Load... looks like I accidentally included the demo that was updated for the next ShellTree version, which eliminates the need for that.

    Or just update the OpenToItem sub to the future version;
    Code:
    If bLoadDone = False Then Exit Sub
    Dim lpFull As Long, sFull As String
    si.GetDisplayName SIGDN_DESKTOPABSOLUTEPARSING, lpFull
    sFull = LPWSTRtoStr(lpFull)
    If (sFull <> "") Then
        If sFull = sSelectedItem Then Exit Sub
    End If
    bNavigating = True
    bFlagBlockClkExp = False
    pSetRedrawMode False
    Hourglass True
    lLoopTrack = 0
    DebugAppend "OpenToItem " & sFull
    If IsUSBDevice(sFull) Then
        DebugAppend "OpenToItem->Detected USB device, ensuring add..."
        Dim hrua As Long
        hrua = USBDeviceEnsureAdded(sFull)
        DebugAppend "OpenToItem->EnsureAdd result=" & hrua
    End If
    DebugAppend bExpandTarget
    TVNavigate si, bExpandTarget, bSelectTarget
    Hourglass False
    pSetRedrawMode True
    bNavigating = False

  7. #167
    Addicted Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    177

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

    Okay. Next problem with ShellBrowseDemoEx

    OutputDirList (which is Command3). If I have one or more items selected in the UCShellBrowse1 control then a listing is output to the Immediate windows so that is okay. However, if there is nothing selected in the control, when I click on this button I get an error message "Subscript Out of range" and execution halts at line 316

    Code:
    Set pArSel = ucShellBrowse1.SelectedItems
    My guess is that there needs to be a check to ensure that at least one item is selected in the control before that line of code executes. I tried to insert UCShellBrowse1.SelectedItems.GetCount but that didn't work.

  8. #168
    Fanatic Member
    Join Date
    Jan 2020
    Posts
    929

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

    .The cost of developing controls is too high. It is best to give him a separate module. It is convenient for other people to be quoted. First, it is necessary. Well, super programming ability. Most It is difficult to get repaired when you encounter different bugs. The more difficult problems are more difficult.

    If a control needs three or five modules. Each module is marked with detailed functions and how to call the method.

    VB 6 has been abandoned by Microsoft more than 20 years, I do not know how the development in other countries, how many people use?

  9. #169

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

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

    Quote Originally Posted by MountainMan View Post
    Okay. Next problem with ShellBrowseDemoEx

    OutputDirList (which is Command3). If I have one or more items selected in the UCShellBrowse1 control then a listing is output to the Immediate windows so that is okay. However, if there is nothing selected in the control, when I click on this button I get an error message "Subscript Out of range" and execution halts at line 316

    Code:
    Set pArSel = ucShellBrowse1.SelectedItems
    My guess is that there needs to be a check to ensure that at least one item is selected in the control before that line of code executes. I tried to insert UCShellBrowse1.SelectedItems.GetCount but that didn't work.
    Yeah it was just meant to display selected items.... ucShellBrowse.SetSelectedItemArray is the source of the error, and should have the following sanity check:
    Code:
    If cpidl Then
        Dim pdo As oleexp.IDataObject
        psfCur.GetUIObjectOf 0&, cpidl, apidl(0), IID_IDataObject, 0&, pdo
        If (pdo Is Nothing) = False Then
            oleexp.SHCreateShellItemArrayFromDataObject pdo, IID_IShellItemArray, siaSelected
        End If
    End If
    (it's encountering an undim'd apidl() )


    I actually did add a counter, .ItemsSelectedCount, but that has a bug too, it doesn't differentiate between 0 and 1 because it's checking an array of paths and just reporting the UBound... it should be:
    Code:
    Public Function ItemsSelectedCount() As Long
    If UBound(sSelectedFiles) = 0 Then
        If sSelectedFiles(0) = "" Then
            ItemsSelectedCount = 0
        Else
            ItemsSelectedCount = 1
        End If
    Else
        ItemsSelectedCount = UBound(sSelectedFiles)
    End If
    End Function
    The other counts all use a different method so are ok (you could e.g. check FilesSelectedCount+FolderSelectedCount which actually do do that check I missed here).

    Apologies for more bugs, I'll have to update it tonight... I run through most common things in pre-release tests but it's just getting so complex that the few hours a week I have to work on it don't leave as much time to testing as needed.



    @xiaoyao I'm not entirely sure what you're saying... this is just a personal fun project for me, I'm not spending any money developing this control. And there's pros/cons to splitting things up into different modules. It's great for a full project, but just for an individual control, I like having it as self-contained as possible.

  10. #170
    Addicted Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    177

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

    No problem. All of us here appreciate the time and effort you put into this. We've all got day jobs (most anyway) so we understand limited time constraints. Thanks so much for developing these controls.

  11. #171

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

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

    Glad it's appreciated

    All those bugs and some others are now covered:



    Project Update: Version 9.6
    A number of small bug fixes make this release needed. Most critically, .SelectedFiles returned an error if nothing was selected. Also got in a couple small improvements; the focus issues are resolved even better now that the control box buttons are API created, custom shortcut overlays are loaded for Med/L/XL Icon and Thumbnail modes, and the View/Bookmark menus popup under the buttons (if that's where they're launched from) instead of whereever the mouse is.

    Note on working with ucShellTree: That project has been updated such that there's no longer a need for a variable to track when a directory change is happening, so now all you need in the DirectoryChange event for ucShellBrowse is:
    Code:
    Private Sub ucShellBrowse1_DirectoryChanged(ByVal sFullPath As String, siItem As oleexp.IShellItem, pidlFQ As Long)
        ucShellTree1.OpenToItem siItem, False
    End Sub
    You'll want to grab the new version (2.6) of that before you run DemoEx or DemoOpenDlg in this download, as they've been updated to reflect this change and will error with an older version (and DemoEx accidentally had in the previous version, before 2.6 was released).


    Name:  ucsb96.jpg
Views: 25
Size:  27.5 KB
    If you've set up custom shortcut overlays, they're now loaded. If not, no worries, it defaults to the system one if not set.

    Code:
    'New in Version 9.6 (Released 03 Apr 2021)
    '
    '-Replaced VB CommandButtons in Control Box with API-created ones, to avoid any
    ' remaining focus issues. Will do the Columns and Search popups at some point.
    '
    '-The View Menu and Bookmark Menu now pop up under their respective buttons,
    ' instead of wherever the mouse cursor is, which might be way off if it opened
    ' from a keyboard press rather than click. The right-click on the ListView back
    ' will still of course open at that point.
    '
    '-If the system shortcut overlay has been changed, used that instead. Only
    ' currently supported in Med/L/XL icon and Thumbnail Views. Can be disabled with
    ' the bUseCustomShortcutOverlay User Option.
    '
    '-(Bug fix) In certain modes, overlays wouldn't load.
    '
    '-(Bug fix) Fallback images for when ComCtl6 wasn't present, and the non-themed
    '           back button image, had mysteriously vanished.
    '
    '-(Bug fix) If the Back/Fwd button were normal buttons, if they weren't enabled
    '           the tab cycle would get stuck
    '
    '-(Bug fix) If you used a very large font for the file controls, but not for the
    '           main UserControl font, and the Search Box was not visible, the bottom
    '           of the Up/View/Bookmark buttons could be truncated.
    '
    '-(Bug fix) Memory leaks in thumbnail generation.
    '
    '-(Bug fix) .SelectedItems would cause an error if no items were selected when
    '           it was called.
    '
    '-(Bug fix) .ItemsSelectedCount return 0 for both 0 and 1 items, then was off by
    '           one for more.
    '
    '-(Bug fix) If you started in Files Only mode, and changed to Dir+Files or Dir
    '           Only + Ctls during runtime, in some circumstances the control box
    '           height would be too small and cut things off.

  12. #172
    Fanatic Member
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    747

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

    Ignoring xiaoyaiao' gibbersiht completely. You are doing a good job faf.

Page 5 of 5 FirstFirst ... 2345

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