Skip to main content
gamedev.net
🔒 Locked

Question about MessageBox() function...

Started by RegularKid Dec 21, 2001 at 6:31 PM 4 replies 150+ views
Original Post
RegularKid
RegularKid
I''m using the MessageBox() in a DirectX program but I''m having a problem. The message box works, but it comes up behind the direct draw surface so I can''t see it. How do I fix this. Here''s my code: MessageBox(NULL, "There was an error in DirectX", "Error", MB_OK); Thanks.
AdmiralBinary
AdmiralBinary
Don''t use DDSCL_EXCLUSIVE

Hope this helps...

---------------

I finally got it all together...
...and then forgot where I put it.
gmcbay
gmcbay
Why are you passing NULL in as the first argument to MessageBox? That tells it to use the desktop as its parent, which will cause it to up behind your primary surface window if you''re in fullscreen mode.

Pass the HWND to your window (the one that holds the primary surface) and it should work -- I know it works in DX8, I don''t remember if there were issues with it in DX7, etc.
Beer Hunter
Beer Hunter
If you pass your hwnd as the owner, then whether it works or not can even vary between driver versions... and with some drivers, whether it works or not can be completely random. FlipToGDISurface() wins.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.