Modify OPENFILENAME to folder selection.

Hello,
I need to modify the Open/Save dialog, so it are used for selecting a folder. I don't want to use BROWSEINFO.
Right now I have made so my Open dialog is hooked with a UINT_PTR CALLBACK OFNHookProc procedure.
But how do I modify the dialogbox so it returns a folder path instead of a filepath?
I know it is possible but even after a lot of search on the internet I have still not found the solution.

Regards,

Simon H.A.
What about SHBrowseForFolder() winapi ?
http://msdn.microsoft.com/en-us/library/bb762115(v=vs.85).aspx
I see you say you don't want to use BROWSEINFO, by which I presume you mean SHBrowseForFolder. Is there a particular reason? Or do you just not like the way it looks/acts?

SHBrowseForFolder is the Windows way, and would make your app consistent with other (conforming) apps.
I don't really like the UI for this dialogbox. I'd would rather like to have the same dialog box style as you use with the GetOpenFileName.
Right now I just use the SHBrowseForFolder so if you know a solution to modify the other dialogbox to accept folders then I would be pleased to hear the solution.

Regards,

Simon H.A.
OK...

And I've just learnt that the Word dev team agrees with you! (I normally just accepts the default config for Word, as I'm lazy, so only learnt about this from the article I mention below.)

The following codeproject.com project might be of interest. It should be possible to un-MFC-ize the approach, but as I haven't given it a go, I'm not sure.

"XFolderDialog - a folder selection dialog based on CFileDialog"
http://www.codeproject.com/KB/dialog/XFolderDialog.aspx

Andy
Last edited on
I will give it a try and return back with my results in a couple of days (I'm quite busy right now).

Regards,

Simon H.A.
Topic archived. No new replies allowed.