Posts: 729
Threads: 104
Joined: Jan 2003
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?
Posts: 320
Threads: 9
Joined: Dec 2004
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]
Posts: 251
Threads: 22
Joined: Dec 2004
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
Posts: 729
Threads: 104
Joined: Jan 2003
Thanks a lot. It worked perfectly. Even better, I found a method to get the hWnd of my SDL window, so it works great.
You may want to add 'win/' to your includes in the example though, since you need them in .13