Sign in to follow this  

GetClientRect Failed

This topic is 4883 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 get GetClientRect Failed when I close my window by pressing the X button in the corner. To fix it, I use PeekMessage(..., PM_NOREMOVE) just before calling Present() and only call Present if the message is not WM_QUIT. This fixes the problem. Is there another approach though? I couldn't seem to get WM_CLOSE to work right...it never caught WM_CLOSE. Thanks, Chris

Share this post


Link to post
Share on other sites
That sounds like a good fix to me. If you're catching the WM_QUIT message, then you don't want to do anything else besides process the rest of the messages in the queue, and then close out the program.
I can't say for certain why it is you aren't able to catch the WM_CLOSE message, though I wonder if you're trying to do it outside of the WindowProcedure function? If you are, then try catching it and processing it inside of WindowProcedure.

Share this post


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