Click here to Skip to main content
14,037,996 members
Click here to Skip to main content
Add your own
alternative version


40 bookmarked
Posted 9 May 2003

Enumdesk Clones

, 9 May 2003
Rate this:
Please Sign up or sign in to vote.
Eunumdesk Clones

Sample Image - EnumdeskClones.gif


This article shows the technique of creating a Windows-Explorer like interface using the Shell Folders for this purpose. Instead of the disk file structure, you also have the usual Windows-Explorer like features, Shell pop-up menu and to some extend drag-and-drop features. After having written articles on system file browsing which used Disk-Directory structures for processing information, I felt the need to write some article, true Windows-Explorer like articles using the same type of icons. I explored MSDN and found that it contained references to a similar interface named Enumdesk, but the article was providing very sketchy information spread over 4 pages and even that information was incomplete (I thank them for it, at least I could search for information and write this article). The article referred to some structure, what was the full composition of the structure, how do they allocate memory to the structure before passing it to the tree /list items. Information about processing ITEMIDLIST (like copy, concatenate) were also likewise not easy to find or not available. I persisted and managed to find some information in the .NET version of Visual Studio which helped me find the bare minimum necessary information to complete this article. Subsequently just for fun sake I added an ATL/WTL and Win32 version.

This article consists of the following 3 projects:

  • ShellExplorer (MFC Version)
  • ATLWindowsExplorer (ATL/WTL Version)
  • Win32Explorer (Win32 Version)
  • Classes
    • ShellViewClasses
    • ShellCtrlClasses


This is a MFC version having 3 views, a Tree or Folders view at the left-top, a Files or List view at left-bottom and another ListView /Webbrowser view at the right.

This version has an interesting feature, if in the Listview at the left-bottom you double-click on files of type GIF, text, C, CPP, H the file is displayed in the ListView at the right.

The list view at right also doubles as files browser or web-page browser, you can open a web-page from the menu or browse files by expanding the Tree view at the left-top.

The right-top view when used under Windows2000 has sort facility and also additional columns not available under Windows98 (a pop-up menu displays when you right click on a column header). It also has drag-n-drop features. If you have short-cuts for OLE-aware applications like Paintbrush, Excel, NotePad etc., you can drag-n-drop a file of these types on these applications short-cut from this view or create short-cuts on the desktop. But not in the TreeView at the left-top, but if you drag an item from the right-top view and move to cursor on the plus sign of the TreeView, you do get a feeling of drag-n-drop but code for drop has been commented out due to errors, likewise you can also fake drag-n-drop from the left-bottom view to the TreeView above.


This project was created using an Appwizard downloaded from Microsoft's website, you can create Bitmaps on window menus and also pop-up menu with the least amount of effort in this environment, it uses a Win32 like programming style but you will note that most of the source code written by me is in the Header file (.H) not .cpp files. When used under Windows 98 the menus have a sliding effect. All necessary header files which come with the wizard have been added to this project to avoid errors at compile time, these header file have the prefix atl.


It is very much similar to the above two projects, it has a fake drag-and-drop like feature, gives one the feeling that a drag-n-drop is actually in progress, but the coding for drop operation is missing. Try dragging from the Files View (right-side) to the plus-sign in the Folders view to see the effect.

This project has a splitter control between the two views, unlike MFC and ATL/WTL which have CSplitterWnd and CSplitterWindow controls respectively. There is no such control available for Win32 applications, the Enumdesk sample from Microsoft uses the edge of the Tree and List controls to create a splitter, but I have used a splitter control which I got from a web-site named Catch22.

Using the code

Comments wherever applicable have been inserted in the code files of the classes but not to the above mentioned project.

This project contains 2 classes for creating Windows-like GUI at your end, you can use these classes to create either Views or Controls on Dialog. Download the source zip file and unzip to your local folder, files are as given below:

  • Classes (Folder)
    • ShellViewClasses (Folder)
      • ShellClass.cpp
      • ShellClass.h
      • ShellViewClasses.cpp
      • ShellViewClasses.h
    • ShellCtrlClasses (Folder)
      • ShellClass.cpp
      • ShellClass.h
      • ShellCtrlClasses.cpp
      • ShellCtrlClasses.h

Adding files to your project

After creating you project you can add the above downloaded class files by selecting from the Visual Studio menu. Project->Add To Project->Files and then select the class files to add. You have to add all 4 files depending on which type of project you are creating (View CShellViewClasses OR Dialog CShellCtrlClasses. CShellClass is similar in both cases).

Creating Views

To create view style Windows-Explorer like project, create a new project from the Visual Studio Wizard, select "MFC AppWizard (exe)" , lets name the project Test. Next select "Single Document" for type of application, click "finish".

Drag-Drop /copy the files listed in the Classes\ShellViewClasses folder as shown in "Using the Code" section above. Add the class files to you project as show in the section "Adding Files to your Project" (this is not essential).

To create only a Files View (TreeView) open the Test.cpp for editing, add the following line at the top (after TestView.h).

#include "ShellViewClasses.h"

In the InitInstance() function change:

// To 

Build and execute the project.

To create a two-pane user interface, use the same project created above, in the MainFrm.h file add the following:

// Attributes
       CSplitterWnd  m_Splitter;   // Add this line

Open MainFrm.Cpp for editing, Add the following line at the top (after MainFrm.h).

#include "ShellViewClasses.h"

Using the class-wizard add the virtual-function OnCreateClient, delete this line in the created function return CFrameWnd::OnCreateClient(lpcs, pContext); and copy paste the following lines of code in this function:

 m_Splitter.CreateStatic(this, 1, 2);
 // Create TreeView
 if(!(m_Splitter.CreateView(0,0 , RUNTIME_CLASS(CShellTreeView),
                                          CSize(200,0), pContext)))
     TRACE("Problem creating TreeView");
     return FALSE;
// Create ListView
if(!(m_Splitter.CreateView(0,1 , RUNTIME_CLASS(CShellListView),
                                            CSize(0,0), pContext)))
     TRACE("Problem creating ListView");
     return FALSE;

// Above CreateView() functions call
// the OnInitialUpdate() functions
// for their RunTime classes
// CShellListView and CShellTreeView

// Get referance of CShellListView class
CShellListView* pFileView = (CShellListView*)m_Splitter.GetPane(0,1);
// Set pointer of TreeView for use in CShellListView class
pFileView->m_pShellTreeView = (CShellTreeView*)m_Splitter.GetPane(0,0);

// Get referance of CShellTreeView class
CShellTreeView* pFolderView = (CShellTreeView*)m_Splitter.GetPane(0,0);
// Set pointer of ListView for use in CShellTreeView class
pFolderView->m_pShellListView = (CShellListView*)m_Splitter.GetPane(0,1);
return TRUE;

Build and execute the project.

Creating a dialog-based project

To create Dialog-based project, Create a new project from the Visual Studio Wizard, select "MFC AppWizard (exe)" , lets name the project TestDialog. Next select "Dialog-based" for type of application, click "finish". From the displayed form, delete the static control IDC_STATIC ("TODO: Place dialog controls here."). Place a tree control at the left and a list control to the right (size them accordingly), add the class files for controls as given in the section "Using the Code" above, and add the files to the project as given in the section "Adding Files to your Project" above.

Open TestDialogDlg.h file for editing. At the top of the file add the following line ( after #endif // _MSC_VER > 1000).

#include "ShellCtrlClasses.h"

Add these 2 lines (after CTestDialogDlg(CWnd* pParent = NULL); ).

CShellListCtrl m_ListCtrl;
CShellTreeCtrl m_TreeCtrl;

Open TestDialogDlg.cpp for editing, add the following lines in the OnInitDialog() function (after TODO: Add extra initialization here).

m_TreeCtrl.SubclassDlgItem(IDC_TREE1, this);

// If you want to use on the Tree Control
// ignore the following 3 lines
m_ListCtrl.SubclassDlgItem(IDC_LIST1, this);
m_TreeCtrl.m_pShellListCtrl = &m_ListCtrl;

Build and execute the project.

That's all.


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

Barretto VN
India India
Nothing to boast about

You may also be interested in...

Comments and Discussions

QuestionRefresh Option required in treeview Pin
Ramya M Rao23-Feb-12 19:31
memberRamya M Rao23-Feb-12 19:31 
QuestionHow to insert a menu when right click blank place? Pin
hays.zhao6-Jun-07 21:26
memberhays.zhao6-Jun-07 21:26 
Questionhow to get path of the folder/file when a folder is select Pin
frodooooo3911-Apr-07 7:46
memberfrodooooo3911-Apr-07 7:46 
GeneralSelectThisItem Pin
Rail Jon Rogut27-Apr-05 22:43
memberRail Jon Rogut27-Apr-05 22:43 
Questioncan you provide IE activex edition? Pin
twj13-Aug-04 23:44
membertwj13-Aug-04 23:44 
GeneralMemory allocation Pin
Member 3752174-Apr-04 3:25
memberMember 3752174-Apr-04 3:25 
GeneralRe: Memory allocation Pin
Barretto VN8-Apr-04 23:48
memberBarretto VN8-Apr-04 23:48 
QuestionDisplay the view when expanding from ListView? Pin
jingz032322-Oct-03 5:43
memberjingz032322-Oct-03 5:43 
AnswerRe: Display the view when expanding from ListView? Pin
Shah Rukh Can2-Nov-03 1:12
memberShah Rukh Can2-Nov-03 1:12 
QuestionCan you add checkboxes support? Pin
jingz032317-Oct-03 10:17
memberjingz032317-Oct-03 10:17 
AnswerRe: Can you add checkboxes support? Pin
Barretto VN22-Oct-03 1:24
memberBarretto VN22-Oct-03 1:24 
GeneralRe: Can you add checkboxes support? Pin
Brijendra Trivedi30-Jun-05 2:00
memberBrijendra Trivedi30-Jun-05 2:00 
GeneralRe: Can you add checkboxes support? Pin
Barretto VN3-Jul-05 2:40
memberBarretto VN3-Jul-05 2:40 
GeneralDouble entries in the map-browser Pin
Gemini_II6-Jun-03 4:12
memberGemini_II6-Jun-03 4:12 
GeneralRe: Double entries in the map-browser Pin
Barretto VN26-Jul-03 21:46
memberBarretto VN26-Jul-03 21:46 
GeneralRe: Double entries in the map-browser Pin
Barretto VN16-Sep-03 2:19
memberBarretto VN16-Sep-03 2:19 
GeneralRe: Double entries in the map-browser Pin
Effiniti17-Nov-03 15:56
memberEffiniti17-Nov-03 15:56 
GeneralRe: Double entries in the map-browser Pin
Barretto VN7-Dec-03 1:58
memberBarretto VN7-Dec-03 1:58 
GeneralRe: Double entries in the map-browser Pin
fabioglauser1-Aug-06 4:42
memberfabioglauser1-Aug-06 4:42 
GeneralTree view on right side Pin
quzi10-May-03 21:30
memberquzi10-May-03 21:30 
GeneralRe: Tree view on right side Pin
Barretto VN11-May-03 3:49
memberBarretto VN11-May-03 3:49 
GeneralRe: Tree view on right side Pin
quzi14-May-03 22:18
memberquzi14-May-03 22:18 
GeneralRe: Tree view on right side Pin
quzi14-May-03 22:24
memberquzi14-May-03 22:24 
GeneralRe: Tree view on right side Pin
LittleCoder10-Sep-03 5:56
memberLittleCoder10-Sep-03 5:56 
GeneralRe: Tree view on right side Pin
Barretto VN16-Sep-03 2:18
memberBarretto VN16-Sep-03 2:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web06 | 2.8.190425.1 | Last Updated 10 May 2003
Article Copyright 2003 by Barretto VN
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid