Jump to content

  • Log In with Google      Sign In   
  • Create Account

Using the same message processor but closing only 1 window


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   -  Reputation: 782

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?



Sponsor:

#2 Paradigm Shifter   Crossbones+   -  Reputation: 5379

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   -  Reputation: 782

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   -  Reputation: 839

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   Crossbones+   -  Reputation: 5379

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   Crossbones+   -  Reputation: 5998

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.



PARTNERS