Archived

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

Lord Maz

MessageBox() while another screen is active

Recommended Posts

Lord Maz    110
I can''t get a messagebox to show when my other screen is active, the screen becomes unselected (gray) but the messagebox isn''t shown, it justs sits in the background. Anyone know how to fix this? -Lord Maz-

Share this post


Link to post
Share on other sites
felisandria    739
What did you put as the parent of your messagebox? Use the messagebox that allows you to define parent, then put NULL as your parent, and it should work... unless your window that''s taking over is marked WND_TOPMOST, in which case crank that down a little to WND_TOP.

This is assuming you''re doing some MFC or Win32 stuff... you''re going to need more help if you''re trying to get an exclusive mode DirectX app to cooperate with GDI stuff like message boxes.

-fel

Share this post


Link to post
Share on other sites
Lord Maz    110
Oh sorry, I noticed now I should''ve been more precise :/

I''m making a all-around wrapper for a game using DirectX as API, but at the moment there''s no Direct3D, I''ve just got a (non-fullscreen) window. No MFC.

I''ve tried both null and parent, nothing worked. What is that WND_TOPMOST stuff you''re talking about? I''ve searched and found nothing about it, could you explain further?

I have no idea if this is any help but as soon as I press the alt button, the message pops up to the front.. maybe I just need some function to put the focus on the message? Or rather de-focus the window or something

-Lord Maz-

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
I ran into this a couple years ago developing on Win2k. The workaround I used was to cause the active rendering context to pause if it lost focus. Basically, on kill focus, I''d skip the render of a single frame which would present the dialog box.

<shrug>

Worked for me at the time.

Share this post


Link to post
Share on other sites
felisandria    739
DirectX and Win32 (which your messagebox is) do not play nice with each other by default. You need to look for a tutorial on using Win32 message boxes and such over DirectX. Otherwise you might sometimes get your message box, but never consistently.

-fel

Share this post


Link to post
Share on other sites
Lord Maz    110
Doh, I fixed the prob I had by mistake catched the WM_PAINT message in winproc, and I returned without doing anything with it :/

Thanks for the help anyway

-Lord Maz-

Share this post


Link to post
Share on other sites