2025-11-27 16:46:48 +09:00

81 lines
7.7 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{\rtf1\ansi\ansicpg1252\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\froman\fprq2 Times New Roman;}{\f3\froman Times New Roman;}}
{\colortbl\red0\green0\blue0;\red0\green0\blue255;\red255\green0\blue0;}
\deflang1033\horzdoc{\*\fchars }{\*\lchars }\pard\plain\f2\fs48\cf1\b COXShellFolderTree\plain\f2\fs48\b
\par \plain\f2\fs16\b Copyright \'a9 Dundas Software Ltd. 1997 - 1998, All Rights Reserved
\par \plain\f2\fs24
\par COXShellFolderTree class is derived from CTreeCrl and implements standard tree control that is automatically populated with Shell Name space folders.
\par
\par 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 \plain\f2\fs24\cf1\ul InitializeTree\plain\f2\fs24 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.
\par After that, the user can navigate through the tree control in the common way.
\par
\par The \plain\f2\fs24\cf1\ul OpenFolder\plain\f2\fs24 function can be used in order to programmatically expand the tree control and select the corresponding item for specified folder:
\par And, finally, in order to retrieve the full path of folder for specified item you can call the following function:
\par
\par \~\~\~ CString \plain\f2\fs24\cf1\ul GetFullPath\plain\f2\fs24 (const HTREEITEM hItem) const;
\par
\par 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
\par COXShellFolderTree properties that define the details of the functionality of the control. Refer to the class function reference for details on them.
\par
\par 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
\par do that you have to call the following function:
\par
\par void \plain\f2\fs24\cf1\ul SetShowFiles\plain\f2\fs24 (const BOOL bShowFiles);
\par
\par 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:
\par
\par \plain\f2\fs24\b OXSHELLTREE_WATCHFORDIR
\par
\par \plain\f2\fs24
\par We have to note that COXShellFolderTree uses COXShellNamespaceNavigator class in order to enumerate Shell Namespace objects. So you have to include
\par the reference to OXShellNamespaceNavigator.cpp file into your project too (unless you link to the Ultimate Toolbox library file or DLL).
\par
\par \plain\f2\fs48\cf1\b
\par COXShellObjectList\plain\f2\fs48\b
\par \plain\f2\fs16\b Copyright \'a9 Dundas Software Ltd. 1997-1999, All Rights Reserved
\par \plain\f2\fs24
\par \plain\f2\fs24\b
\par COXShellObjectList\plain\f2\fs24 class is derived from \plain\f2\fs24\b CListCtrl\plain\f2\fs24 and implements standard list control that is automatically populated with \plain\f2\fs24\b Shell Namespace folders
\par and files\plain\f2\fs24 .
\par
\par As long as \plain\f2\fs24\b COXShellObjectList\plain\f2\fs24 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 \plain\f2\fs24\b CListCtrl::Create\plain\f2\fs24 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:
\par
\par \pard\li360\ri360\plain\f2\fs24 BOOL \plain\f2\fs24\cf1\ul PopulateList\plain\f2\fs24 ();
\par
\par
\par \pard\plain\f2\fs24 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:
\par
\par \pard\li360\ri360\plain\f2\fs24 void \plain\f2\fs24\cf1\ul SetFilter\plain\f2\fs24 ();
\par \pard\plain\f2\fs24
\par
\par 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.
\par
\par In order to retrieve the full path of a folder or a file for the specified item you can call the following function:
\par
\par \pard\li360\ri360\plain\f2\fs24 CString \plain\f2\fs24\cf1\ul GetFullPath\plain\f2\fs24 () const;
\par
\par \pard\plain\f2\fs24
\par These functions are the ones that will be used most often. Also there is set of \plain\f2\fs24\b Set/Get functions\plain\f2\fs24 that are used in order to set/retrieve COXShellObjectList properties that define the details of the functionality of the control. Refer to the \plain\f2\fs24\cf1\ul class function reference\plain\f2\fs24 for details on them.
\par
\par
\par We have to say that Shell Namespace objects can be \plain\f2\fs24\b deleted, created or renamed\plain\f2\fs24 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: \plain\f2\fs24\cf1\ul COXFileWatcher\plain\f2\fs24 . 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:
\par
\par \pard\li360\ri360\plain\f2\fs24\b OXSHELLLIST_WATCHFORDIR\plain\f2\fs24
\par \pard\plain\f2\fs24
\par
\par We have to note that COXShellObjectList uses \plain\f2\fs24\cf1\ul COXShellNamespaceNavigator\plain\f2\fs24 class in order to enumerate Shell Namespace objects. So you have to include
\par the reference to OXShellNamespaceNavigator.cpp file into your project either (unless you don't link to the Ultimate Toolbox library file or DLL).
\par
\par
\par \plain\f2\fs24\b Dependencies:
\par \pard\li360\ri360\plain\f2\fs24 #include "\plain\f2\fs24\cf2 OXShellObjectList.h\plain\f2\fs24 "
\par #include "\plain\f2\fs24\cf2 OXShellFolderTree.h\plain\f2\fs24 "
\par \pard\plain\f2\fs24\b
\par Source code files:
\par \pard\li360\ri360\plain\f2\fs24 "\plain\f2\fs24\cf2 OXShellObjectList.cpp\plain\f2\fs24 "
\par "\plain\f2\fs24\cf2 OXShellFolderTree.cpp\plain\f2\fs24 "
\par "\plain\f2\fs24\cf2 OXShellNamespaceNavigator.cpp\plain\f2\fs24 "
\par "\plain\f2\fs24\cf2 OXFileWatcher.cpp\plain\f2\fs24 " (if \plain\f2\fs24\b OXSHELLLIST_WATCHFORDIR\plain\f2\fs24 is defined)
\par \pard\plain\f2\fs24 \~
\par \pard\plain\f3\fs20
\par }