I am trying to open a dialog box where the user selects a certain folder on pure C++, no .Net framework or C#, and am struggling to find how the lpstr would filter everything but directories. I am currently using the OPENFILENAME function. I tried filtering to .dir, but it does not work. Anyone know the actual extension or any solutons?
Asked
Active
Viewed 269 times
2 Answers
0
Ended up using SHBrowseForFolder() https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shbrowseforfoldera

Crispy-Nuggets-
- 11
- 1
- 4
0
The OPENFILENAME
struct is used with the old GetOpenFileName()
Common Dialog Box, which can't be used to select a folder. It is simply not designed for that purpose.
You need to use SHBrowseForFolder()
instead, or in Vista+ you can (and should) use the newer IFileOpenDialog
Common Item Dialog with the FOS_PICKFOLDERS
option enabled.

Remy Lebeau
- 555,201
- 31
- 458
- 770