Jump to content
  • Advertisement
Sign in to follow this  
jbailey

MessageBox not displaying

This topic is 4851 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 having a problem getting the windows MessageBox function to display a message box. I think that it has something to do with multithreading though because the only time it doesn't display is after I create another thread. Also, it won't work even if I create a thread, delete the thread, and then try to display the message box in the main thread.

Share this post


Link to post
Share on other sites
Advertisement
As far as im aware it should always work, passing NULL as the window handle anyhoo.


ace

Share this post


Link to post
Share on other sites
You aren't running the process as a service, are you?

Like stated by ace_lovegrove, passing in NULL or 0 as the first parameter might help.

One other last ditch effort is to try some of the following flags for the uType parameter:

MB_TOPMOST
MB_TASKMODAL
MB_APPLMODAL
MB_SYSTEMMODAL
MB_SERVICE_NOTIFICATION (if you are indeed running it as a service)

Share this post


Link to post
Share on other sites
No, it's not running as a service. I tried a few combination of those flags, but to no avail. Now I'm really confused because, it's actually being called before the multithread creation because its right after an exception is thrown. It works fine unless its after the thrown exception even if I place it at the very beginning of the catch segment.

Share this post


Link to post
Share on other sites
I recently experienced the same kind of thing. It appeared as though MessageBox's weren't working after a thrown exception. After spinning my wheels for a few minutes I noticed the exception had nothing to do with it. It was the fact that I was posting a quit message before the exception was thrown. Then when I tried to display the message box, it's message pump fails because it catches the quit message. I fixed it by simply hiding the main window rather than posting the quit message.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!