Game Development Community

Windows Common Dialog

by David Barr · in Torque Game Engine · 08/18/2005 (9:26 am) · 6 replies

Is it possible to use windows common dialogs - for example a file dialog using GetOpenFileName() in TGE?

Yes/No/Maybe?

I have tried a few things and cannot get anything apart from a custom dialog to display.

Thanks

#1
08/18/2005 (11:27 am)
Displaying a windows dialog would defeat the crossplatform-ness of TGE. Plus, the engine likes to limit the access of files outside the mod directories for security reasons. The windows file dialogs allow you to access any file on the system.

Of course, if you don't care about these things, you can add the functionality yourself if you're not averse to engine coding.
#2
08/18/2005 (12:13 pm)
This happened in the Show Tool Pro (using platform specific dialogs).

Torque provides a set of platform independent message and file open/save dialogs; they're much improved in 1.4.
#3
08/19/2005 (9:33 am)
@Adam and Ben

For the game I am working on, I am using the provided dialogs which work very well within that context.

I am wanting the common dialogs for a completely different project which is a specific windows only app. I have solved the problem of displaying a dialog (the code was fine but I had not changed the linker target to subsystem:windows).

Having only ever used a RAD tool for windows apps before, learning all the underlying window creation and API calls is interesting to say the least.

All I have to work out now is how to get round the aparent maiming of the texture manager when I do open a dialog :/
#4
08/19/2005 (12:48 pm)
Opening a Win32 dialog shouldn't affect Torque as long as you are running in windowed mode.
#5
08/20/2005 (3:32 am)
@ Ben

You are right - I now know that if you dont reset the working directory after using the file open dialog to open a file from somewhere else then you shouldnt be surprised when the resManager cant find anything :)
#6
08/20/2005 (3:01 pm)
Heheh... Yes, that's definitely true. :)