I'll attempt to explain my plan of action here, since its a bit long for IRC. Here goes:

My goal is to have a dialog box that functions like a CFileDialog, except that it will also allow folders to be selected (not just files). There's a shell API function that allows both files and folders to be selected, but that won't work - I also need multiple selection, which it does not support. I'm a bit new to MFC programming (at least subclassing), so here's my plan of action. Please let me know if its feasible or maybe if any of you have additional suggestions... Thanks.

  1. Create a CFileDialog derivative, that uses an alternate dialog template, containing one button. This button would eventually replace the "Open" (or alternately, "Save As") button that CFileDialog has...
  2. Somewhere in the dialog initialization, hide that "Open" button, and replace it with the custom button from my dialog template...
  3. I think I found that I can access the list control (where all the files/folders are displayed) with a hook procedure, so (?) I'd use that to access what's selected when my custom button is clicked. That would allow me to override what occurs when the button is clicked, so that I can create/return a list of selected entries in the list control.

Like I said, I'm pretty new to subclassing, so if this seems unclear/unfeasible/impossible, please let me know. And if it is feasible, I'd greatly appreciate any help or examples on the specifics of what needs to be done to accomplish it. I have searched the web for classes that have the functionality I want, but all of them seem to be lacking in some way -- I don't feel a pressing urge to reinvent the wheel. Thanks for reading, and any help you can provide.