Jump to content

View more

Image of the Day

Working on an auto spawn system. #gamedev #indiedev #screenshotsaturday https://t.co/Mm2kfekz7b
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Using the same message processor but closing only 1 window

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
5 replies to this topic

#1 noatom   Members   

925
Like
0Likes
Like

Posted 27 February 2014 - 11:15 AM

So I have 2 dialog boxes that use the same dialog processor. The problem is,when one closes,it closes the other too because of the PostQuitMessage().

 

What can I do to be able to close only one?



#2 Paradigm Shifter   Members   

5832
Like
2Likes
Like

Posted 27 February 2014 - 11:23 AM

Why are you using PostQuitMessage to close a dialog? EndDialog takes a HWND of the dialog to close.


"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

#3 noatom   Members   

925
Like
1Likes
Like

Posted 27 February 2014 - 12:07 PM

Because I didn't know about EndDialog untill now,so thanks sleep.png



#4 cdoubleplusgood   Members   

895
Like
2Likes
Like

Posted 27 February 2014 - 01:10 PM

Wait - you have 2 dialog boxes displayed at the same time? So these are non modal dialogs? In that case, using EndDialog is wrong. EndDialog is for modal dialog boxes only.



#5 Paradigm Shifter   Members   

5832
Like
1Likes
Like

Posted 27 February 2014 - 01:14 PM

Good point, to destroy a modeless dialog call DestroyWindow (although you can hide them instead sometimes rather than keep creating and destroying them all the time).


"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

#6 Aardvajk   Members   

13051
Like
0Likes
Like

Posted 28 February 2014 - 03:53 AM

PostQuitMessage causes a WM_QUIT to be posted to the message queue, GetMessage() returns false when it finds WM_QUIT so this usually breaks out of the message loop entirely in a normal Win32 application and exits WinMain. Not sure if you have an explicit message loop or not but this is the reason.






Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.