Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can I use win32 to bring up a Browse dialog?
#1
I'd like to throw the browse dialog box to the OS to do in the djrpg level editor if I can, since file systems and such represent almost an entire file manager I don't want to have to write just for a dialog box!!

So is there a way I can just use the win32 api to bring up a browse dialog box?
Reply
#2
Do you mean browse for a file or browse for a directory? To browse for a file, you'll need to use GetOpenFileName() or GetSaveFileName(). The syntax of these (in C) is described by the Win32 API here:

GetOpenFileName
GetSaveFileName

If you're looking to just browse for a directory, use SHBrowseForFolder:

SHBrowseForFolder

Somebody wrote an example of using the GetOpenFileName() in FreeBASIC not long ago. It's not hard, it's just really laborious having to fill in the OPENFILENAME structure.
img]http://www.cdsoft.co.uk/misc/shiftlynx.png[/img]
Reply
#3
Quote:Somebody wrote an example of using the GetOpenFileName() in FreeBASIC not long ago. It's not hard, it's just really laborious having to fill in the OPENFILENAME structure.
here is the link with the code I provided:
http://forum.qbasicnews.com/viewtopic.php?t=9101
Reply
#4
Thanks a lot. It worked perfectly. Even better, I found a method to get the hWnd of my SDL window, so it works great. Big Grin

You may want to add 'win/' to your includes in the example though, since you need them in .13 Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)