Jump to content
  • Advertisement


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

How to close one window at a time.

This topic is 5555 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''d been studying TOWGPG for the last few days. I am stuck at the end of chapter 2(page 92). I could''t figure out a way to close one window at a time for example 2.5. Does anyone knows how to do that?

Share this post

Link to post
Share on other sites
Since they all use the same window procedure this is what you can do. Add the following variable to the beginning of the window procedure.

static int window_count = 0;

For the WM_CREATE message add


And in the WM_DESTROY case write

if (window_count <= 0)
PostQuitMessage (0);
return 0;

Now the application won't shutdown until the last window is closed.

[edited by - microdot on March 5, 2003 11:37:33 PM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!