Browsing FOR directories

Started by
3 comments, last by Zipster 22 years, 6 months ago
I''m trying to find a common dialog box where I can actually select a directory and not a file. I''m using pure Windows API, and can''t find any remotely related flag in the OPENFILENAME structure that would tell it to pick a directory. I know I''ve seen countless programs that make use of such a dialog box, but can''t find any common dialog box. Even if I have to make my own, I''m using MSVC 5.0 resource creator, and can''t find any controls that list directories, like VB''s DirListBox.
Advertisement
Do something like this:
  char Title[] = "Title of thingy";char Buffer[MAX_PATH];LPMALLOC pMalloc;BROWSEINFO bi = { NULL, NULL, (char *)Buffer, (char *) Title, NULL, NULL, NULL, NULL };SHGetMalloc(&pMalloc);LPITEMIDLIST wsa;if(wsa=SHBrowseForFolder(&bi)) {  SHGetPathFromIDList(wsa, PassReceiverHere);  pMalloc->Free(wsa);}  


[Resist Windows XP''s Invasive Production Activation Technology!]
Wow, the shell API.. thanks, I''ll explore that!
Woah that''s awesome... thanks! The code is kinda "dirty", but hey it works
I found that in an MSDN example after searching for a couple days a long while back. There''s lots of Windows stuff that''s hidden in there (like making links and stuff) .

[Resist Windows XP''s Invasive Production Activation Technology!]

This topic is closed to new replies.

Advertisement