Results 1 to 4 of 4

Thread: [VB6] Shell Controls OCX

  1. #1

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

    [VB6] Shell Controls OCX


    ShellControls for VB6 10.0.2.6
    ShellBrowse 10.0 R4 and ShellTree 2.6
    Updated 29 April 2021

    I'll be posting my ShellBrowse and ShellTree controls as a single OCX from now on in addition to the regular versions for anybody interested in using them this way.

    Both controls are marked Safe for Initialization and Scripting with IObjectSafety.

    The zip includes SxS resources to create programs that use the ocx registration-free. In your project with the ocx, simply include either manifest-- one also includes Common Controls 6.0 and is highly recommended, the other simply the sxs info, then install the ocx to the same directory as the exe and you're good to go, the control won't need to be registered on the end-user machine.

    The source code is identical to the public releases, but I'm attaching them with the project file used to compile the ocx so you can produce a hash-identical version to verify.
    For all the sample projects and version history, download the source from the ShellBrowse and ShellTree main threads. The attachment here is just the barebones version required to build the OCX.

    Requirements:
    -oleexp.tlb is still required in the IDE if you need to use any events with an IShellItem or IShellItemArray parameter, or if you're going to use one of those from the control properties in your project.

    -Also: It is very strongly recommended that any projects with these use Common Controls 6.0 manifests.
    This zip also includes a generic .res file for your projects that adds ComCtl6 support, or a .manifest version to insert into your own resource.


    UPDATE (3/22): Project updated to use ucShellBrowse 9.5 R1.
    UPDATE (3/25): Project updated to use ucShellBrowse 9.5 R2.
    UPDATE (4/03): Project updated to use ucShellBrowse 9.6 and ucShellTree 2.6.
    UPDATE (4/22): Project updated to use ucShellBrowse 9.6 R3
    UPDATE (4/23): Project updated to use ucShellBrowse 9.7
    UPDATE (4/24): Project updated to use ucShellBrowse 10.0
    UPDATE (4/28): Project updated to use ucShellBrowse 10.0 R2
    UPDATE (4/29): Project updated to use ucShellBrowse 10.0 R3

    UPDATE (4/29 (again)): Project updated to use ucShellBrowse 10.0 R4
    Attached Files Attached Files

  2. #2

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

    Re: [VB6] Shell Controls OCX

    Demo for OCX Version

    Here's a brand new demo that references the OCX version. It's set up as a file processor: Configured to display a bare minimum, to gather a list of files, list them by their name, but store them by their full path to process them.

    The CommonControls 6.0 Default Resource that's included with the OCX is demo'd as well.

    Name:  scvb6.jpg
Views: 43
Size:  44.6 KB

    The TreeView is using all default settings except PlayNavigationSound = False, since the ShellBrowser will play that sound.

    To configure the ShellBrowser to get the above, here's all the Properties that have been changed from their default:
    AutosizeColumns = True - The ColumnHeader is invisible but there. This keeps its width to the control width with no horz scroll.
    ControlType = SBCTL_FilesOnly - Only the ListView. No ComboBox, Control Box, Search Box, or NavButtons (but they will appear on View menu).
    DefaultColumns = (blank) - This leaves only the Name column there by default.
    DetailsPane = False - No room for it.
    EnableLayout = False - Keep the Layout submenu off the View Menu (right-click on background).
    EnableNewFolder = False - Can't create a new folder when FilesOnly = True. A future version will hide the New Folder item automatically.
    EnableSearch = False - Searching should be unavailable.
    FilesOnly = True - The TreeView is right next to the control, no need to duplicate folders.
    HideColumnHeader = True - We're using Details View to keep files in a single verticle column, not really show Details View.
    LockColumns = SBCL_LockNoUser - Otherwise new folders would load new columns.
    LockView = True - No room for other views, keep them off the View background menu.
    MultiSelect = False - Right now our demo isn't handling multi files selected.

    And that's it, now you have a plain, basic file display despite the complexity of the control!

    Other options to keep in mind: If you right-click the background, the View menu still has some options enabled: The Bookmarks submenu is present, Group By is there but can only group by name. The rest should be fine; Back/Forward, Sort Direction, Copy Path, Select All, Refresh, and Properties; Paste works fine... pasted folders will be invisible but there, pasted files are added to the view.
    Attached Files Attached Files

  3. #3

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

    Re: [VB6] Shell Controls OCX

    Known Issues

    The same Known Issues from the project pages apply, in addition to the follow unique to the OCX.

    • When you first create a ShellBrowse control, the ListView header displays a black system font instead of the control font. You do not need to do anything about this, the correct font will be displayed when run and then subsequently in design mode as well. It's unknown why this happens.
    • Other fonts may also be defaults instead of what they were set to by defaulting to the font of the control parent, just run or reload the form to refresh them, again no need to change.

  4. #4
    Addicted Member
    Join Date
    Jun 2016
    Location
    Espaņa
    Posts
    235

    Re: [VB6] Shell Controls OCX

    very good work.
    This issue went unnoticed for me. I have almost no time to go into other subforums XD
    better use the two controls together
    I have the same problems oleexp 4.8 and codebank 4.8
    a greeting

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