MFC GetClientRect and MoveWindow not save size?

I am using MFC for Visual Studio 2003. I have an Edit control with an identifier IDC_COMMENT_EDIT. In the following code, after my first call, GetClientRectI do not expect the value to rcchange.

CWnd* pWnd = GetDlgItem(IDC_COMMENT_EDIT);
if (pWnd != NULL)
{
  RECT rc;
  pWnd->GetClientRect(&rc);
  pWnd->MoveWindow(&rc, TRUE);
  pWnd->GetClientRect(&rc);
}

rc.topand rc.leftpass 0all over, as expected. However:
After the first call, GetClientRectI get rc.bottom == 52and rc.right == 575.
After the second call, GetClientRectI get rc.bottom == 48and rc.right == 571.

Does anyone know what is going on?

+3
source share
2 answers

MoveWindow . GetWindowRect GetClientRect.

client area, (, ) .

+5

rect , MoveRect , . GetWindowRect.

+3

Source: https://habr.com/ru/post/1725768/


All Articles