Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
BrowseForFolder - Non-limiting InitDir
Hello Gintaras,
I am using the BrowseForFolder in a dialog and taking advantage of the initdir argument. Is there any way, I can set a default subfolder location in the directory tree as the InitDir but still let the user browse above that subfolder. Right now, it limits the user to the initdirectory as the top level. The way I would like to use it is when the user changes the location via a BrowseForFolder, the new selected folder becomes the initdir via setting the global variable to be used in any other subsequent calls on BrowseForFolder in the dialog. This however requires that they can still navigate anywhere up or down the windows directory tree. Not sure if this will require a new function flag or is an existing feature that I don't know how to access.

Thanks so much!
flag 4

Macro Macro1549
Copy      Help
str+ g_initdir
if(!g_initdir.len) g_initdir="c:\windows"
if(!BrowseForFolder(_s g_initdir 4)) ret
Fantastic! Works great. I saw the 4 flag but it says "New style" in the documentation. I didn't know what that meant. I should have just tried it :oops:
I see now from MSDN:
Quote:BIF_NEWDIALOGSTYLE (0x00000040)

0x00000040. Version 5.0. Use the new user interface. Setting this flag provides the user with a larger dialog box that can be resized. The dialog box has several new capabilities, including: drag-and-drop capability within the dialog box, reordering, shortcut menus, new folders, delete, and other shortcut menu commands.


Version 5.0. Use the new user interface, including an edit box. This flag is equivalent to BIF_EDITBOX | BIF_NEWDIALOGSTYLE.

Thanks a million, as always, for making such an incredible tool and for expanding my programming horizons!!!


Forum Jump:

Users browsing this thread: 1 Guest(s)