Sign in to follow this  
Supernat02

GetClientRect Failed

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this