COXShellFolderTree
Copyright © Dundas Software Ltd. 1997 - 1998, All Rights Reserved

COXShellFolderTree class is derived from CTreeCrl and implements standard tree control that is automatically populated with Shell Name space folders.

As long as COXShellFolderTree is standard tree control all information regarding the process of creation of the control is the same as for CTreeCtrl. You can explicitly create it using CTreeCtrl::Create function or put it in dialog template and use it any Dialog Window. The only difference is that you don't explicitly populate it with data. You only have to call InitializeTree after the control was created. Here you can specify the path to folder that must be used as the root (if empty root folder was specified then desktop folder will be used as the root). This function will populate tree control with Shell Namespace objects. 
After that, the user can navigate through the tree control in the common way. 

The OpenFolder function can be used in order to programmatically expand the tree control and select the corresponding item for specified folder: 
And, finally, in order to retrieve the full path of folder for specified item you can call the following function:

    CString GetFullPath(const HTREEITEM hItem) const;

These three function are the ones that will be used most often. Also there is set of Get/Set functions that are used in order to set/retrieve 
COXShellFolderTree properties that define the details of the functionality of the control. Refer to the class function reference for details on them.

Note that by default, COXShellFolderTree displays only system folders but you also can setup the control to show the file items as well. In order to 
do that you have to call the following function:

    void SetShowFiles(const BOOL bShowFiles);

We have to say that Shell Namespace objects can be deleted, created or renamed at any time and the process of spying for such changes is not trivial to implement. Ultimate Toolbox library has the following class that implements the functionality we need: COXFileWatcher. We decided to use it in the COXShellFolderTree in order to update the displayed contents. We consider it as an advanced functionality that you might or might not like to have in your applications. By default it is not supported but you can include this functionality in your application by putting the following define in your project settings:

    OXSHELLTREE_WATCHFORDIR

We have to note that COXShellFolderTree uses COXShellNamespaceNavigator class in order to enumerate Shell Namespace objects. So you have to include
the reference to OXShellNamespaceNavigator.cpp file into your project too (unless you link to the Ultimate Toolbox library file or DLL).

COXShellObjectList
Copyright © Dundas Software Ltd. 1997-1999, All Rights Reserved

COXShellObjectList class is derived from CListCtrl and implements standard list control that is automatically populated with Shell Namespace folders
and files.

As long as COXShellObjectList is standard list control all information regarding the process of creation of the control is the same as for a CListCtrl. You can explicitly create it using CListCtrl::Create function or put it in dialog template and use it in any Dialog Window. The only difference is that you mustn't explicitly populate it with data. You only have to call the following function after the control was created:

BOOL PopulateList();

where you can specify the path to folder that must be used as the root one (if empty root folder is specified then desktop folder will be used as the root one). This function will populate list control with Shell Namespace objects. You can specify a filter for files to be included in the list control using this function:

void SetFilter();

After control is populated users can navigate through the list control in the way they would do that in Windows Explorer. That means that if you double click on a folder item the list control will be automatically repopulated with the descendands of the clicked folder. Or if you right click the context menu will popup and you can invoke listed commands on the selected item.

In order to retrieve the full path of a folder or a file for the specified item you can call the following function:

CString GetFullPath() const;

These functions are the ones that will be used most often. Also there is set of Set/Get functions that are used in order to set/retrieve COXShellObjectList properties that define the details of the functionality of the control. Refer to the class function reference for details on them.

We have to say that Shell Namespace objects can be deleted, created or renamed at any time and the process of spying for such changes is not trivial to implement. Ultimate Toolbox library has the following class that implements the functionality we need: COXFileWatcher. We decided to use it in the COXShellObjectList in order to update the displayed contents. We consider it as an advanced functionality that you might or might not like to have in your applications. By default it is not supported but you can include this functionality in your application by putting the following define in your project settings:

OXSHELLLIST_WATCHFORDIR

We have to note that COXShellObjectList uses COXShellNamespaceNavigator class in order to enumerate Shell Namespace objects. So you have to include
the reference to OXShellNamespaceNavigator.cpp file into your project either (unless you don't link to the Ultimate Toolbox library file or DLL).

Dependencies:
#include "OXShellObjectList.h"
#include "OXShellFolderTree.h"

Source code files:
"OXShellObjectList.cpp"
"OXShellFolderTree.cpp"
"OXShellNamespaceNavigator.cpp"
"OXFileWatcher.cpp" (if OXSHELLLIST_WATCHFORDIR is defined)