CFileTreeCtrl provides an MFC class which provides a tree control similar to
the left hand side of Windows Explorer with the major addition that you can also
show files in it.
The enclosed zip file contains source
code for the class along with a VC 2017 solution file to build a standard doc /
view based app as well as a dialog based app to demonstrate the code.
Copyright
- You are allowed to include the source code in any product (commercial, shareware,
freeware or otherwise) when your product is released in binary form.
- You are allowed to modify the source code in any way you want except you
cannot modify the copyright details at the top of each module.
- If you want to distribute source code with your application, then you are
only allowed to distribute versions released by the author. This is to maintain
a single distribution point for the source code.
Updates
25 July 2020
- Please note that the author has now released
ShellCtrls2 which uses the Windows Shell enumeration API's to provide a
more accurate implementation of a Shell tree control as well as a new Shell
list view control also. It also fixes some of the limitations of this
control. As such, you should consider this code obsolete and use
ShellCtrls2 in new development.
v1.62 (4 May 2020)
- Fixed more Clang-Tidy static code analysis warnings in the code.
v1.61 (15 March 2020)
- Updated copyright details.
- Fixed more Clang-Tidy static code analysis warnings in the code.
v1.60 (21 December 2019)
- Fixed various Clang-Tidy static code analysis warnings in the code.
- Updated initialization of various structs to use C++ 11 list
initialization
v1.59 (29 September 2019)
- Fixed a number of compiler warnings when the code is compiled with VS
2019 Preview
v1.58 (21 July 2019)
v1.57 (6 June 2016)
- Updated copyright details.
- Updated the sample project settings to more modern default values.
- Updated the code to clean compile on VC 2013 - VC 2015.
- Fixed a security issue in the sample app in the use of LoadLibrary on "UXTheme.dll".
- Updated the dialog based sample app's main icon.
- The code now gracefully handles the situation where calls to SHGetDesktopFolder
or SHGetMalloc fail during control initialization.
- Fixed a bug where you could not drag an item to a network share.
- The code now shows shortcuts using an overlay mask. This is similar to how
shared folders are optionally already shown by the control with an overlay mask.
- Fixed a issue where the Current User Folder was not showing with a customized
icon.
- Fixed an issue in the sample app where the control would fail to show some
icons initially due to the fact that the sample app was not initializing OLE
on startup.
- Added SAL annotations to all the code
v1.56 (7 April 2013)
- Minor update to the code in DisplayNetworkComputer method.
- Fixed a spelling mistake in EnumNetwork method.
v1.55 (6 April 2013)
- Updated copyright details.
- Updated the code to compile cleanly on VC 2010 and later
- Reworked CFileTreeCtrl::AddMultipleFileNameMasks to use CString::Tokenize
- Removed old Win9x code path from CShareEnumerator class.
- Reworked the CSystemImageList class to remove the defunct Win9x code path.
- Removed the static instances of CSystemImageList and CShareEnumerator. These
changes along with the Win9x changes means that the code no longer supports
running on Win9x.
- Reworked the code so that calling SetRootFolder on a UNC server name now
works. The issue was that a path of the form "\\MACHINENAME" is not
a true file system path because only paths of the form "\\MACHINENAME\SHARE"
allow file enumeration. The code now explicitly checks the path and instead
enumerates the network resources below the UNC server name even when SetRootFolder
has been called. Thanks to Jan Moorman for reporting this issue.
v1.54 (8 January 2009)
- Updated copyright details.
- Fixed a bug in DisplayPath when it calls InsertFileItem to show the root
folder. The CFileTreeCtrlItemInfo pointer passed to InsertFileItem was not being
initialized with a valid m_NodeType value. Thanks to Colin Bouckaert for reporting
this bug.
- Fixed a bug in SetSelectedPath if you are trying to select a path when SetRootFolder
and SetShowRootedFolder have previously been called. Thanks to Colin Bouckaert
for reporting this bug.
v1.53 (13 December 2008)
- Optimized the memory usage by removing the m_bFileItem member variable from
CFileTreeCtrlItemInfo. Instead now whether an item is a File (as opposed to
a folder) is encoded into the m_NodeType value. In addition the m_nodeType value
has been made a BYTE value. This helps to save an additional 4 bytes per node.
Thanks to Michael Mötje for prompting this update.
v1.52 (6 July 2008)
- Code now compiles cleanly using Code Analysis (/analyze)
- Updated code to compile correctly using _ATL_CSTRING_EXPLICIT_CONSTRUCTORS
define
- Shares shown underneath the Network node no longer show the share icon overlap.
This is consistent with how Windows Explorer shows these items.
- Fixed a bug where CFileTreeCtrl::OnChange was not being called due to the
fact that its message map entry was declared incorrectly. Thanks to "Roland"
for reporting this bug.
- Fixed a bug in CFileTreeCtrl::SetSelectedPath where the expansion state
of a folder was not being correctly set.
- Updated the sample app to allow the expansion state of the selected path
to be set.
- Fixed an issue where files and folders were not being displayed when the
desktop node was being reexpanded.
- Fixed an issue setting up m_sFQPath for some network node items in EnumNetwork
- During testing of the SetSelectedPath and because the control primarily
uses file paths to identify a node, refresh of items which do not have a corresponding
path will fail in OnRefresh. Examples of this include "My Network Places"
and "My Computer" amongst others. Until I develop a new version of
the control based on Shell PIDLs, this will be a deficiency of the current approach
taken by CFileTreeCtrl
- Following analysis of the auto refresh behaviour of Windows Explorer, the
control now only monitors notifications for changes in the current directory
and not all drive letters or recursively from the current directory. This helps
to improve the robustness of control when change notifications are received.
v1.51 (2 May 2008)
- Updated copyright details.
- Updated the sample app to show how to implement a Vista style explorer tree
view if it is running on Vista. This functionality is implemented at the client
app level instead of the control code itself, so you can use this code from
the sample app if you want your client app's file tree control to look like
Vista's explorer.
- Removed VC 6 style appwizard comments from the code.
- General review and cleanup of all the code
- The code has now been updated to support VC 2005 or later only.
- Optimized CFileTreeCtrlItemInfo copy constructor code
- Removed CFileTreeCtrl::SetFlags method as it did not add any functionality
to the class.
- DRIVE_ATTRIBUTE_* defines are now enums in the CFileTreeCtrl class.
- Fixed bug in DisplayPath where if the desktop does not contain any files
or folders, you would not get a plus button for the desktop. Thanks to Steven
Tomer for reporting this bug.
- Prev and Next item stacks now store HTREEITEM's directly in their arrays.
- The control now supports showing the current users folder instead of (or
in addition to) the "My Documents" folder, similar to how the tree
control behaves in Windows Explorer on Vista. Note that the control does not
show the "Public" folder which Vista's Windows Explorer shows, because
this is implemented as a shell extension whereas this control is a ground up
implementation of a file tree control which does not use the Shell API's for
enumerating the Shell Namespace.
- All the classes have been renamed from CTreeFileCtrl... to CFileTreeCtrl...
v1.50 (16 October 2007)
- Fixed a bug where if you attempt to create a new folder within a drive and
then immediately rename that folder to something else, the shell throws an error
about renaming a file and changing it's parent drive. Thanks to Michael Stephenson
for reporting this bug.
- Fixed a bug where if you delete a folder and it is the only folder under
it's parent folder, the parent retains it's "minus" icon, even though
it no longer has any children. Thanks to Michael Stephenson for reporting this
bug.
- Fixed a bug where if you create a folder in a parent folder which did not
have any child items, the parent folder would not show the "minus"
icon correctly. Thanks to Michael Stephenson for reporting this bug.
v1.49 (13 June 2007)
- Reviewed class code for use of C++ casts instead of old style C casts.
- Desktop node item now includes a file system path in its CFileTreeCtrlItemInfo
pointer
- Made all BOOL members of CFileTreeCtrlItemInfo a "bool" to conserve
memory usage
- Replaced CFileTreeCtrlItemInfo member variables "m_bDesktopNode", "m_bNetworkNode" & "m_bMyDocumentNode"
with a single enum member variable
- Fixed a bug where rename would previously be allowed for nodes such as My
Documents, My Computers etc
- Fixed a bug where delete would previously be allowed for nodes such as My
Documents, My Computers etc
- Desktop node now also includes files and folders as found on the desktop.
Also the ordering of items on the desktop is consistent with how Explorer displays
the desktop.
- The shell is notified that a new directory has been created in CreateFolder
via the SHChangeNotify API
v1.48 (9 June 2007)
- Updated comments in documentation about usage of the Platform SDK.
- Internal WM_TREEUPDATE_CHANGE message is now defined as WM_APP instead of
WM_USER
- CreateFolder method now takes a second parameter which allows the new child
folder name to be set. If you leave this parameter as the default value of _T("")
then the new folder name will be created by calling the virtual CreateNewChildFolderName
function. This function has also been updated in this release to better encapsulate
how a new folder name is created.
- Return value from CreateFolder method is now a HTREEITEM instead of a BOOL
- Reworked the internal logic of CreateFolder method to avoid the need to
call the Refresh method. As a result the user experience is much improved due
to the elimination of the tree updates.
v1.47 (6 June 2007)
- Now supports in place creation of folders. Thanks to Phil Gibson for prompting
this update.
v1.46 (22 April 2007)
- Fixed a bug in CFileTreeCtrl::OnItemExpanding when the control is created
with the TVS_SINGLEEXPAND style. What was happening was that if for example
you selected C:\program files using SetSelectedPath, then you selected "C:\"
using the same function and then you selected "D:\", the control will
end up showing no plus button on the C node. Thanks to John Emmas for reporting
this quite difficult to find bug.
v1.45 (13 April 2007)
- Updated IsDropSource method to now allow drag / drop of folders. Thanks
to Kirk A. Baker for reporting this useful update.
- The class now supports multiple filename masks. To support this new functionality,
an updated / new set of functions have been provided, namely: AddMultipleFileNameMasks,
SetFileNameMask, AddFileNameMask, RemoveFileNameMask, GetFileNameMask &
GetFileNameMasks. Thanks to Fedor Gavrilov for this nice update.
v1.44 (30 March 2007)
- The icons used for computer nodes in Network neighborhood is now cached
in the CFileTreeCtrl constructor. This is a further improvement over the caching
of the local computer name approach which was used in the last version of the
code. If you do not want to use this approach, then you can define a FILETREECTRL_CACHE_COMPUTER_ICON
preprocessor value which will result in the computer icon being found when actual
network enumeration is performed. Thanks to Fotis Xomeritakis for this nice
optimization.
v1.43 (17 March 2007)
- Updated copyright details.
- Updated the sample apps to clean compile on VC 2005
- Added a preprocessor define "FILETREECTRL_NO_RESOURCES" which
allows you to use the CFileTreeCtrl code without the need to pull in any resources.
Please note that this will lead to reduced functionality of the control, for
example drag and drag will not be supported and all the menu functionality will
also be excluded. For exact details on what is out when you define this value,
just look for all occurences of FILETREECTRL_NO_RESOURCES in the FileTreeCtrl.cpp
module. Thanks to saukwan chou for reporting this issue.
- Optimized CFileTreeCtrl constructor code.
- Optimized CFileTreeCtrlThreadInfo constructor code.
- Optimized the code which gets the icon and "selected" icon for
network servers which are displayed by the class. What the code does is cache
the local machine name in the constructor and uses it to get the icon for a
server when the code is enumerating servers. This does mean that if MS ever
brings in a mechanism to allow customization of the icon on a server by server
level, then CFileTreeCtrl will ignore this. Thanks to Fotis Xomeritakis for
providing this optimization which really helps speed up the performance of CFileTreeCtrl
when browsing domains or workgroups with a large number of workstations and
servers.
- Optimized CShareEnumerator constructor code.
- Sample Binaries included in download are now compiled with VC 2005 SP1
v1.41 (1 July 2006)
- Fixed a bug where expansion of UNC folders failed. Thanks to Jan Moorman
for reporting this bug.
v1.42 (1 July 2006)
- Updated the code to clean compile on VC 2005
- Code now uses new C++ style casts rather than old style C casts where necessary.
v1.40 (22 June 2006)
- Fixed a bug where expansion of the Desktop node fails on subsequent expansions.
Thanks to Jan Moorman for reporting this issue.
v1.39 (18 June 2006)
- Replaced all calls to ZeroMemory with memset
- Replaced all calls to CopyMemory with memcpy
- Optimized CFileTreeCtrlItemInfo constructor code
- Now includes code to optionally show "Desktop" as the root node.
Thanks to Hans Dietrich for this very nice addition
- Removed some now deleted files from the project.
- Fixed a minor typo in the Allow Properties menu item in the sample app.
- Now includes code to optionally show "My Documents". Thanks to
Hans Dietrich for this very nice addition.
- Fixed bug where m_bExtensionHidden setting was not being copied in CFileTreeCtrlItemInfo
constructor.
- Renamed SetDisplayNetwork to SetShowNetwork and GetDisplayNetwork to GetShowNetwork
for consistency with all the other functions of the same type.
v1.38 (25 January 2006)
- Updated the documentation to use the new style which the web site uses.
- Updated copyright details.
- Removed the GetChecked / SetChecked methods as CTreeCtrl as of VC++ 6 includes
equivalent functionality.
- The CanDisplayFolder method has been updated to use logic similar to the
CanDisplayFile virtual function. This new functionality is controlled by a new
m_dwFolderHideFlags variable which can be modified via the functions SetFolderHideFlags &
GetFolderHideFlags. Thanks to Bob O'Neil for this update.
- Reviewed all TRACE statements for correctness.
- Fixed an issue where you get an ASSERT in the code when you are using XP
manifest support and you are using the TVS_CHECKBOXES style in your CFileTreeCtrl.
The issue seems to be a bug in Commctrl v6 custom draw notifications as this
problem does not occur if you are not using XP themes. Thanks to Bob O'Neill
for this update.
v1.37 (21 June 2005)
- Fixed a bug where drag and drag mechanism had problems when trying to drag
an item into a folder immediately after the root item. Thanks to Larry Paul
for reporting this bug and provinding the fix.
- Fixed a number of compiler warnings when the code is compiled using Visual
Studio .NET 2003.
v1.36 (17 April 2005)
- Addition of TVIF_HANDLE to the mask fields in the functions GetIconIndex(HTREEITEM
hItem), GetSelIconIndex(HTREEITEM hItem) and SetHasPlusButton(HTREEITEM hItem,
BOOL bHavePlus). This avoids ASSERTs when the class is derived from the SECTreeCtrl
class in the Stingray Objective Toolkit. Thanks to Greg Marr for reporting this
problem.
- Addition of a "FILETREECTRL_EXT_CLASS" define to the class defintions. This
makes the code easier to use in an extension DLL.
- Code now uses the TVITEM structure name rather than TV_ITEM which is in
line with what is recommended by MS.
- Code now uses the TVINSERTSTRUCT structure name rather than TV_INSERTSTRUCT
which is in line with what is recommended by MS.
- Class now uses a preprocessor define of FILETREECTRL_BASE_CLASS to define
the class which CFileTreeCtrl is derived from. This allows the class to be used
with the Stingray Objective Toolkit without needing to modify the CFileTreeCtrl
source code.
- Optimized the code which deletes child nodes by now using TVE_COLLAPSERESET
flag.
- Removed the unused function NumberOfChildItems.
- Code now uses the NMTREEVIEW structure name rather than NM_TREEVIEW which
is in line with what is recommended by MS.
- Removed the now unused DeleteChildren method.
v1.35 (9 July 2004)
- Fixed a memory leak in the NETRESOURCE structure if client code returned
FALSE from CFileTreeCtrl::CanDisplayNetworkItem. Thanks to Michael Oerder reporting
this problem.
24 October 2003
- Updated the Usage section of the documentation to describe the need to copy
across the appropriate resources from the sample app.
5 October 2003
- Updated the Usage section of the documentation to describe an issue you
may encounter when you use the class in a CDialogBar derived class.
18 August 2003
- Removed CSortedArray from the download as it is available as a separate
download now.
v1.34 (5 July 2003)
- Updated the WM_DEVICECHANGE message handler in the sample app to use the
correct function signature for Visual Studio 6 and later. Thanks to Ed Eichman
for reporting this issue.
- Fixed a bug in the documentation of CFileTreeCtrl::SetDriveHideFlags. Thanks
to Ed Eichman for reporting this issue.
- Now documents the functions SetAutoRefresh and GetAutoRefresh. In addition
by default auto refresh is now turned off. Thanks to Ed Eichman for pointing
this out.
- Move sample workspace up to VC 6.
v1.33 (10 June 2003)
- Custom draw is now not used for items underneath Network Neighborhood. This
means that some items there will just display the standard network neighborhood
icon. To resolve this issue you would need to implement a completely new solution
using the shell API's. Thanks to John Noël for reporting a custom draw bug in
this area which has forced this change.
- m_sFQPath is now not filled in for virtual items such as My Computer and
Network Neighborhood. Thanks to Hans Dietrich for this suggestion.
v1.32 (31 May 2003)
- Fixed a bug where the filename mask was being ignored.
v1.31 (27 February 2003)
- Fixed more problems with refreshing and rooted paths. Thanks to Michael
J. Ryan for spotting this.
v1.30 (26 February 2003)
- Fixed a bug in CFileTreeCtrl::PathToItem which was causing refreshes to
fail when a rooted folder was being displayed. Thanks to Michael J. Ryan for
spotting this.
v1.30 (24 January 2003)
- Made CSortedArray::Find method const. Thanks to Serhiy Pavlov for reporting
this.
v1.29 (31 December 2002)
- Items are now sorted using the TVM_SORTCHILDRENCB Tree Control message.
This means that the class is no longer dependent on the CSortedArray class.
That class has been left in this download for convenience only. Thanks to "Vladi"
for this suggestion.
v1.29 of CSortedArray (11 December 2002)
- Optimized code by replacing all calls to CArray<>::ElementAt with
CArray<>::GetData
v1.28 of CSortedArray (6 December 2002)
- Rewrote the Sort method following reports of further problems by Serhiy
Pavlov and Brian Rhodes.
v1.28 of CFileTreeCtrl (22 September 2002)
- Removed a number of unreferrenced variables from the code, as highlighted
by Visual Studio.Net. Thanks to Bill Johnson for spotting this.
28 August 2002
- Updated sample app to automatically refresh upon removal or addition of
removal disk drives. Thanks to "kimo" for this update.
7 August 2002
- Fixed a bug in the sample app which ships with the class which was occuring
when you compiled the code in Visual Studio.Net. This was due to MS changing
the location oleimpl2.h header file. Thanks to Darren Schroeder for spotting
this problem.
v1.27 of CFileTreeCtrl (5 June 2002)
- Implemented function "SetUsingDifferentColorForEncrypted" which was declared
but had no implementation.
- Fixed report of uninitialized member variable "m_nTimerID". Thanks to Emil
Isberg for spoting this.
v1.27 of CSortedArray (29 May 2002)
- Fixed a problem in CSortedArray::OrderedInsert. Thanks to John Young for
spotting and fixing this problem.
- Updated copyright and usage instructions
v1.26 (16 February 2002)
- Updated copyright message
- Fixed a drag/drop problem which caused the tree state to be inconsistent
after the file was dropped.
- Fixed a bug in the refresh code which was causing it to not reselect the
selected node after the refresh occurs. Thanks to John Noël for this fix.
- Fixed a problem where the custom draw icons for network nodes were not being
drawn in the correct positions when scrollbars were present in the control.
Again thanks to John Noël for this fix.
- Fixed a bug in SetSelectedPath which would not display the correct selection
if the node we want to select has been deleted due to the node becoming deleted
when it was previously collapsed. Thanks to Franz Fackelmann and John Noël for
spotting this problem.
v1.25 (24 December 2001)
- Fixed a copy and paste bug in GoForward. Thanks to Michael T. Luongo for
this fix.
- Now allows encrypted files to be displayed in a different color
- Fixed memory leak which was occuring when control was being used in a dialog
- Fixed a problem with the calculation of idents when the style "TVS_LINESATROOT"
is used.
v1.24 (26 October 2001)
- Fixed some stability problems with the code. This was due to adding items
to the system image list. This is normally a very bad thing. Instead now the
code uses TreeView custom draw (just like the blue color for compresed items)
to draw the icons for the Network Neighborhood items. Thanks to Darken Screamer
and Timo Haberkern for spotting this problem.
v1.23 (1 October 2001)
- Fixed another bug in CSortedArray::Sort!. Thanks to Jim Johnson for spotting
this.
v1.22 (11 August 2001)
- Fixed a bug in OnSelChanged which was causing a crash when you right click
on an empty area of the control. Thanks to Eli Fenton for spotting this one.
- The control now by default shows drives as children of "My Computer" just
like in Explorer.
- When you display a rooted directory in the control, you now have the option
of displaying the root folder in the control as the root item. Thanks to Eli
Fenton for suggesting this.
v1.21 (11 August 2001)
- Improved checking to see if action is allowed in Rename and Delete
- Fixed a bug in OnBeginLabelEdit
- Fixed a problem in OnEndLabelEdit which was causing renames to fail when
filename extensions were not being shown.
v1.2 (5 August 2001)
- You can now optionally display Network Neighborhood
- You can now turn on / off display of file extensions.
- You can now display shared items with a different icon
v1.15 (5 May 2001)
- Updated copright message.
- Fixed a resource leak where icon resources were not being released. Thanks
to Jay Kohler for spotting this problem.
v1.14 (2 October 2000)
- Fixed a stack overwrite problem in CSystemImageList::CSystemImageList.
- Removed an unreferrenced variable in CFileTreeCtrl::OnSelChanged
- Removed an unreferrenced variable in CFileTreeCtrl::OnItemExpanding
- Changed the SendMessage in CFileTreeCtrl::OnDblClk to prevent a crash which
was occurring when the open call sometimes caused a refresh call which changed
the tree items at times. When the double click message handler continued it
then caused item expand notifications for items already deleted and of course
crashes.
- Removed an unreferrenced variable in CFileTreeCtrl::EndDragging 6. Removed
an unreferrenced variable in CFileTreeCtrl::KillNotificationThread
- Sample app now remembers the selected path and its expansion state across
invocations. Thanks to Mike Funduc for finding all these problems.
v1.13 (20 September 2000)
- Control now includes DECLARE_DYNCREATE thereby allowing it to be used in
code which requires this such as Stingray's SEC3DTabWnd. Thanks to Petter Nilsen
for pointing out this omission.
v1.12 (5 September 2000)
- Fixed a bug in CFileTreeCtrl::IsFile and CFileTreeCtrl::IsFolder
v1.11 (27 August 2000)
- Fixed another stack overflow problem in CSortedArray::Sort.
- Fixed a problem in CSortedArray::Sort where the comparison function was
returning negative values, 0 and positive values instead of -1, 0 & 1. Thanks
to Ted Crow for finding both of these problems.
- Updated the documentation for SetCompareFunction on what values are expected
to be returned from it.
v1.10 (24 July 2000)
- Fixed a bug where the expansion state of the selected item was not being
preserved across refreshes.
- Now includes full support for Next / Prev support similiar to Windows Explorer
with the Desktop Update.
- Updated sample app to have some useful toolbars.
- Changing any tree settings which can affect its appearance now force a refresh
of its contents.
- ItemToPath method has been made const.
- Addition of PathToItem method
- Auto refresh of items is now provided for by means of change notification
threads. This is configurable via the SetAutoRefresh method.
- The root folder of the tree control can now be changed from the sample app
- Fixed a bug in SetRootFolder when passed an empty folder
- Fixed a bug where the system image list was not being initialized correctly
if the user did not have a "C:\\" drive. This could occur on NT/Windows2000
- Fixed a bug in IsFile and IsFolder which was causing invalid files or folders
to appear valid.
- Deleted items are now removed upon expansion. Also if the item being expanded
was deleted and it was the only child, then its parent has the "-" expansion
button removed
- Removable drive nodes are collapsed back to their root nodes if their media
is changed in the intervening time when a node expansion occurs.
- Wait cursor is now displayed while a refresh is taking place.
- A "OnSelectionChanged" virtual function has now been provided
- Sample app's icon has been made the same as Explorers.
- Sample app now displays the path name of the currently selected item in
the tree control.
- Fixed a bug in IsCompressed
- items are now deleted when selected if they do not exist.
v1.09 (18 July 2000)
- Now uses ON_NOTIFY_REFLECT_EX instead of ON_NOTIFY_REFLECT for handling
reflected messages. This allows derived classes to handle these messages also.
Thanks to Christian Dahl for this.
- Sample app now allows drag drop behaviour to be toggled
- Fixed a problem whereby two items were left selected after you did a drap
/ drop operation. Thanks to Jonathon Ralston for this.
- Removed function declaration for unused function "InsertDriveItem".
- Removed an unreferenced variable in InsertFileItem.
- Tidied up the UpOneLevel functions and made it public.
- Removed all the message handlers in the sample code which reflect straight
down to the tree control. Instead the OnCmdMsg first routes the message to this
class.
- Renamed all menu items which CFileTreeCtrl uses to include the prefix TREEFILECTRL
- Renamed all the methods to more generic names
- PreTranslateMessage now uses PostMessage instead of calling functions directly.
This allows up to function correctly for derived classes in addition to correctly
disabling items through the OnUpdate mechanism
- Removed an unreferrenced variable in OnRclick
- Removed the unreferrenced variable m_hSelItem
- Optimized a number of expressions by putting the boolean comparisons first
- m_bAllowRename parameter is now observed for in place editing of an item
- Now supports hiding of Drive types via the SetDriveHideFlags function. See
the menu options on the Tools menu in the sample program for its usage.
- Filename masks can now be specifed via the SetFileNameMask method. See the
menu options on the Tools menu in the sample program for its usage.
- File types can now be specified via the GetFileHideFlags function. See the
menu options on the Tools menu in the sample program for its usage.
- Fixed a small issue in one of my calls to ::GetKeyState
- Fixed a bug where programs was crashing if an icon index for it could not
be found.
- Made many of the methods of CFileTreeCtrl virtual, thus allowable better
use in end user derived classes.
- Fixed problem where SetSelectedPath(_T("C:\\"), FALSE) was resulting
in the drive being expanded even through FALSE was being sent in to specify
that the item should not be expanded.
- A virtual "CanDisplayFile" has been added to allow you to decide
at runtime whether or not a certain file is to be displayed.
- A virtual "CanDisplayFolder" has been added to allow you to decide
at runtime whether or not a certain folder is to be displayed
- Now optionally displays compressed files in a different color, similiar
to explorer. The color is customizable through the class API.
- Code has been made smarter so that it does not have to spin up the floppy
disk to determine if there are files on it. It now initially displays a "+"
and only when you try to expand it will it do the actual scan.
v1.08 (13 May 2000)
- Fixed a problem where items on the context menu were being invoked for the
wrong item when you right mouse click over an item that is not the selected
item. Behaviour now is that the item is selected prior to showing the context
menu. Now, this is same behaviour as Explorer.
v1.07 (2 April 2000)
- Fixed a small bug in CFileTreeCtrl::SetRootFolder
- Fixed the problem with initialisation errors in the code. Client code must
not explicitly call PopulateTree when the window is created. When used in a
dialog resource this is not necessary as it is called for you in the DDX functions.
- Sample app now also include the control in the about box as an example.
v1.06 (29 February 2000)
- Fixed a problem in CSortedArray::Sort when there are no items in the array
v1.05 (22 February 2000)
- Fixed a problem in CSortedArray::Find when there are no items in the array
v1.04 (21 February 2000)
- Fixed a number of problems in CSortedArray::Find
v1.03 (31 January 2000)
- Fixed a problem when you right mouse click over a non - selected item. The
control now implements the same behavior as Explorer for this.
- Removed check for keyboard invocation of the context menu in OnContextMenu
- Now displays the context menu over the selected item when invoked via the
keyboard. Again this is the same behavior as Explorer has.
- Optimized the code in PreTranslateMessage.
- Fixed a bug in CFileTreeCtrl::OnEndlabeledit
- Some of the menus in the sample app have been fixed.
- Menu items have been added to the sample app to allow the SetAllow... functions
to be tried out.
v1.02 (25 January 2000)
- Minor update to the code in CFileTreeCtrl::OnDblclk to only allow selected
items to be opened.
v1.01 (12 January 2000)
- Added some asserts to HasGotSubEntries.
- Fixed a problem with calling OnDblclk when no tree item is selected.
- Removed an unused variable from SetSelectedPath.
- Fixed a stack overflow in CSortedArray::Sort.
- Now supports check boxes with each item in the tree control.
v1.0 (27 December 1999)