3

I found all the code I need to make SHBrowseForFolder work in my application. But I hate that it forces you to do everything in the little folder window, without a text box to navigate by typing.

In Windows, I know I commonly see a different folder browse dialog that does let me type folder names and use the other regular navigation keys to get around to select the desired folder (backspace, "..", Enter, and so on).

Is there a different API call for that?

ErikE
  • 48,881
  • 23
  • 151
  • 196

3 Answers3

2

Try this:

a.ulFlags = BIF_RETURNONLYFSDIRS | BIF_NEWDIALOGSTYLE | BIF_EDITBOX;
Brian R. Bondy
  • 339,232
  • 124
  • 596
  • 636
  • Thanks! I had dinner and then when I got back to work I decided I'd just move forward with the old dialog. Then I found the answer, too. But you were first and complete. Thanks. – ErikE Apr 15 '10 at 04:42
1

No, you have to do something like this: SelectDialog - A Multiple File and Folder Select Dialog (http://beta.codeproject.com/KB/MFC/SelectDialog.aspx)

Windows programmer
  • 7,871
  • 1
  • 22
  • 23
  • While that tool looks cool, it's not really what I asked for. It IS possible to get what I asked for, so your answer is, well, wrong. – ErikE Apr 15 '10 at 04:40
  • You are right, I misinterpreted what you were asking for. By the way since you can get the source for that tool you can limit it to only let the user select one folder, so you can get what you asked for, but yes for your purposes it's overkill. – Windows programmer Apr 15 '10 at 06:15
1

When you call SHBrowseForFolder you just need to add the BIF_EDITBOX flag to the ulFlags field.

Zoë Peterson
  • 13,094
  • 2
  • 44
  • 64