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


CWnd::CalcWindowRect returns an incorrect window size.

Recommended Posts

I want to resize the window so that the client area measures 524x524. I use this code to make a CRect of the correct size:
CRect rect( 0, 0, 524, 524 );
CalcWindowRect( &rect );
SetWindowPos( NULL, 0, 0, rect.Width(), rect.Height(), SWP_NOZORDER | SWP_NOMOVE | SWP_NOREDRAW );
The problem is that it's calculating the window 4px too small so the right and bottom are cut off by 4px. I did a screen cap and it came out that the client area was 520x520. Am I doing something wrong here or what? Edited by - Screndib on March 18, 2001 6:18:54 PM

Share this post

Link to post
Share on other sites