Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Dialogs within fullscreen Directx

This topic is 5803 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m using Directx 6 and trying to get a dialog to display, I can load and display the dialog but the problem is that it disapears just after i display it, the functionality is there I just can''t see the dialog, do I have to lock the surfaces and flip to the GDI surafce to work, I dont have a clue on how to get this to work, and insight to my problem would be aprreciated. Thanks

Share this post

Link to post
Share on other sites
Hey, I had the same problem,
but this is for DirectX 7, I''m sure there are similar function calls in the previous version, just check the SDK reference.
I was writing a level editor for my sidescroller, I wanted a windows style "export map" dialog, so I used the GDI to make one of them, heres the code that did it:

OPENFILENAME ofn; // common dialog box structure
char szFile[260]; // buffer for file name
szFile[0] = ''\0'';
// Initialize OPENFILENAME
ZeroMemory(&ofn, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = main_window_handle;
ofn.lpstrFile = szFile;
ofn.nMaxFile = sizeof(szFile);
ofn.lpstrFilter = "All\0*.*\0";
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;


// Display the Open dialog box.
if(GetSaveFileName(&ofn) <= 0)
return 0;

The key line here is:

It tells DirectX to scoot over for a sec while the GDI surface is brought to the front. You didn''t mention whether you were using DirectDraw or Direct3D, but this was for directdraw, I bet theres some equivalent for direct3d rm or im in version 6. I guess just check out the sdk reference,

hope this helps,

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!