File and Directory Picker Control
Environment: VC6
The classes that come with Visual Studio for picking files and directories work, but they aren't as clean and user friendly as they should be. My FilePickCtrl class is very similar to what Explorer uses for views, but with some slight differences. The following features are supported:
- Display small or large icons for detected drives
- Display small or large icons for files and directories
- Add filemasks to limit display of files
- Display only directories so the user can only choose a directory
- Turn on/off the display of the current directory

Click here for a larger image.
Small icons for drives and files, with both files and directories being displayed

Click here for a larger image.
Large icons for drives and files, with both files and directories being displayed

Click here for a larger image.
Small icons for drives and files, with only directories being displayed
To add the control to your program, add FilePickCtrl.cpp and FilePickCtrl.h to your project. Drag FilePickCtrlDemo.rc into Resource Editor, expand the Dialog tree, highlight IDD_FILEPICKCTRL_DIALOG, hold down the Ctrl key, drag the dialog into your program's dialog tree, and close the window for FilePickCtrlDemo.rc. Your project should now have a copy of IDD_FILEPICKCTRL_DIALOG in its Resource Editor.

Comments
Great Job!!!!!!
Posted by Legacy on 07/15/2003 12:00amOriginally posted by: Tom Osejo
Great Job!!!!!!
ReplyGreat job!
Posted by Legacy on 04/13/2003 12:00amOriginally posted by: Jean-Marc Molina
Hi,
Nice article, I don't really understand people who say that it's useless. I wanted to design and develop my own CFileDialog and voil�, thanks to you :). However It still believe it's better to inherit from CFileDialog and to redesign it, hide buttons, resize...
Thanks again,
ReplyJM
Thank you for your Code!
Posted by Legacy on 02/14/2003 12:00amOriginally posted by: An ki Cho
Very Nice Program!!!
ReplyDouble click problem
Posted by Legacy on 10/20/2002 12:00amOriginally posted by: Julius
This code is very usefull to me, but I have the following problem:
the shipped executable file works fine, but when I compile the source code and execute (without any modification), a double click in the files/folders list over an empty area generates a "debug assertion failed" error ...
Does anyone have an idea on how to fix this ?
Thanks
J.
ReplyNeed Hellllp. get file timestamp / file properties.
Posted by Legacy on 09/26/2002 12:00amOriginally posted by: Din Krop
Hi,
Can anyone email me how to get file timestamp or file properties or at least get the latest updated file from directory.
My email: bahruddina@yahoo.com
Thanx in advance for ur help.
Regards,
ReplyDin Krop
So nice of you.
Posted by Legacy on 09/04/2002 12:00amOriginally posted by: Sreeram
Hi,
I have struggled a lot to find the solution for this. I asked my colleagues, but anybody hardly knows about it. Now my quest has come to an end. Thank you very much.
Regards
Sreeram
ReplyMemory leak (?) and small code change
Posted by Legacy on 07/10/2002 12:00amOriginally posted by: Linas
ReplyThanks
Posted by Legacy on 06/17/2002 12:00amOriginally posted by: A user
Thanks for saving me quite some work.
Since the original file open / save dialogs do not work in multithreaded COM environments, I could in just a few hours adapt the dialog to my needs without much thinking.
To the ingnorants who posted other comments:
Programming is not always just clicking a few dialogs together.
A user
Replygood work
Posted by Legacy on 06/17/2002 12:00amOriginally posted by: MC
True, the API provides similar Dialogs, BUT this is a good example of how you could do it. I had to implement once a real specialized FileChooser and Viewer and i would have been lucky to find an example like this.
In my opinion are the standard API Dialogs really shit ...
Alea jacta est
Reply
What's this???
Posted by Legacy on 06/14/2002 12:00amOriginally posted by: Eric
I don't understand why you do that?? Win32 has built in fonctions to do this... And in MFC you have the CFileDialog that do that!!
Sometimes, I really don't understand people!!
Eric
Reply