|
-
May 7th, 2002, 12:01 AM
#1
Thread Starter
Hyperactive Member
Browse for folder the MFC way
Anyone know the correct way to implement a browse for folder
dialog with MFC?
Bababooey
Tatatoothy
Mamamonkey
-
May 7th, 2002, 10:03 AM
#2
Take a look at CListBox, : lgDirList and : lgDirSelectEx. This should give you all the knowledge you need to build your own directory selection dialog.
A more modern way involves CListBox (owner drawn with strings), CComboBoxEx and the ::Find*File family. Or maybe the shell namespace. To make a directory selection box in real modern explorer style, use SHGetDesktopFolder to retrieve a IShellFolder interface pointer. Use this interface to walk the complete directory tree (the EnumObjects and BindToObject methods mainly). The retrieved information should be displayed in a tree control.
Sorry, I can't give you any code, this will require some time to learn...
The simplest method (the one listed at the top) can be looked up for API way at
Platform SDK->User Interface Services->Controls->List Boxes->Using List Boxes->Creating a Directory Listing in a Single-Selection List Box
It lists a complete DlgProc for a dialog that does just this. It shouldn't be too hard to translate that to MFC, but be aware that it looks like a relic from Win16
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
May 7th, 2002, 10:20 AM
#3
Thread Starter
Hyperactive Member
yeah unfortunately i chose to go the API way, however in my
search i found some code at codeguru where someone
wrapped the SHBrowseForFolder API for MFC
i'm changing that a bit around now for my likings, thx again
Bababooey
Tatatoothy
Mamamonkey
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|