Advertisement

WM_QUIT vs WM_DESTROY

Started by November 16, 2002 09:45 PM
2 comments, last by Renze 22 years ago
In one of the code samples in "Isometric Game Programming with Direct X" book, the message pump checks for a WM_QUIT message to see if it''s time to quit. I''ve tried to let my program quit by sending the WM_QUIT message from other places of my code, using NULL as the last two parameters, to no avail... WM_DESTROY, on the other hand, will end the program... ...does clicking the X (upper right hand corner ) to close a window send the WM_QUIT message with the correct parameters? If so, what are the parameters that you should send with it if you wanted to do that manually elsewhere? Or is that something completely different? Any input would be extremely helpful, thanks ------------------------------ NE1 HAV LABIS CAMON FRO TRD??
------------------------------NE1 HAV LABIS CAMON FRO TRD??
Clicking on the X causes a WM_CLOSE message to be sent, which calls DestroyWindow by default, sending a WM_DESTROY message to the window, which calls PostQuitMessage to end the message loop and allow the program to exit.

[edited by - bluegrass on November 16, 2002 10:57:54 PM]
Advertisement
Ahh, ok.

So where does WM_QUIT come into play? Is that what PostQuitMessage does?

I think I''ve got most of my head around this now... thanks



------------------------------
NE1 HAV LABIS CAMON FRO TRD??
------------------------------NE1 HAV LABIS CAMON FRO TRD??
You need to pass NULL as the hWnd parameter in GetMessage. NULL means "don''t filter the HWND parameter." Like this:

while( GetMessage( &msg, NULL, 0, 0 ) )
{
// ...
}


The same is true if you''re using PeekMessage.

If I had my way, I''d have all of you shot! codeka.com - Just click it.

This topic is closed to new replies.

Advertisement