Hi,
When I have this code in OnCreate() function, and each time it returns me each different value of ClientRect. Any idea?
Code:CRect ClientRect; GetClientRect(&ClientRect); ClientToScreen(ClientRect);
This is a discussion on GetClientRect() returns value differently every time. within the Windows Programming forums, part of the Platform Specific Boards category; Hi, When I have this code in OnCreate() function, and each time it returns me each different value of ClientRect. ...
Hi,
When I have this code in OnCreate() function, and each time it returns me each different value of ClientRect. Any idea?
Code:CRect ClientRect; GetClientRect(&ClientRect); ClientToScreen(ClientRect);
You should check the return values of those functions to make sure they are succeeding, and call GetLastError() if the function fails. Also, you could use the x, y, cx, and cy values of the CREATESTRUCT structure that is passed to the OnCreate() function to get the window size as well.