Click here to Skip to main content
13,199,669 members (61,880 online)
Click here to Skip to main content
Add your own
alternative version


14 bookmarked
Posted 24 Aug 2007

The Ultimate Toolbox Shell Related Classes

, 24 Aug 2007
Rate this:
Please Sign up or sign in to vote.
The Ultimate Toolbox classes for Shell Namespace navigation, an Application Bar, and more

Visit the Ultimate Toolbox main page for an overview and configuration guide to the Ultimate Toolbox library.



The following classes deal mainly with the areas of the shell namespace, links, app and task bars etc.


The Static Hyperlink sample in action.

COXHyperLinkAction class is to some extent a wrapper around the ShellExecute function.

See the Static Hyperlink article for more on this class and its usage.

Application Bar

The COXAppBar class provides the functionality of a Windows shell application bar.

The MultiClipboard example in the samples\utility\ClipDock directory is implemented as an application bar.

Typically you will derive a class from an instance of the template class after designing the dialog that will be used in the application bar:

class CMyApplicationBarDlg : public COXAppBar<CDialog> {...}

Then in your constructors initialization list you will initialize the base class with the dialog ID and parent window:

CMyApplicationBarDlg::CMyApplicationBarDlg(CWnd* pParent /*=NULL*/)
: COXAppBar<CDialog>(CMyApplicationBarDlg::IDD, pParent)


To start using your class just call Register(TRUE), which registers/unregisters the app bar with the windows shell.

Shell Namespace

COXShellFolderTree, COXShellNamespaceNavigator, and COXShellObjectList allow for iterating and viewing the namespace aspects of the Windows shell.

The COXShellFolderTree in action as part of a directory picker combo in the samples\gui\ComboTree example.

In this sample, the CFolderTree class is declared as a COXTreeComboDropdown using COXShellFolderTree:

class CFolderTree : public COXTreeComboDropDown<COXShellFolderTree>  
     virtual BOOL CanSelectItem(HTREEITEM hItem);
     virtual ~CFolderTree();
     virtual CString GetSelectedItemText();

This class is then declared as a member and created directly - it is then paired with the CComboBox extension class COXComboPickerCtrl to act as the dropdown portion of the control:

// Implementation
    COXComboPickerCtrl m_pckShell;
    CFolderTree m_cmbShell;

    //initializing shell tree

    m_cmbShell.InitializeTree();        // this will initialize the namespace 
                                        // tree beginning with the desktop 
                                        // folder (default)


COXShortcut provides a wrapper for the IShellLink and IPersistFile interfaces.

The demo simply exercises the COX Shortcut m_scDemo object once opened, calling the specified interfaces:

    if (bSuccess == m_scDemo.GetArguments(sBuffer))
        m_sOutput.Format(fmtS, sBuffer);

    sBuffer = m_scDemo.GetCurFile();
    m_sOutput.Format(fmtS, sBuffer);

    if (bSuccess == m_scDemo.GetDescription(sBuffer))
        m_sOutput.Format(fmtS, sBuffer);


The COXTaskbarIcon class encapsulates Win32 API's Shell_NotifyIcon() function to let you easily show, hide, or change icons in Window 95's or Windows NT's taskbar notification area.

See the Taskbar Icon article for more on this class and its usage.


Initial CodeProject release August 2007.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

The Ultimate Toolbox
Web Developer
Canada Canada
In January 2005, David Cunningham and Chris Maunder created, a new group dedicated to the continued development, support and growth of Dundas Software’s award winning line of MFC, C++ and ActiveX control products.

Ultimate Grid for MFC, Ultimate Toolbox for MFC, and Ultimate TCP/IP have been stalwarts of C++/MFC development for a decade. Thousands of developers have used these products to speed their time to market, improve the quality of their finished products, and enhance the reliability and flexibility of their software.
Group type: Organisation

441 members

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.171020.1 | Last Updated 24 Aug 2007
Article Copyright 2007 by The Ultimate Toolbox
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid