我正在使用Visual Studio 2003的MFC。我有一个ID为IDC_COMMENT_EDIT
的编辑控件。
在以下代码中,经过第一次调用GetClientRect
后,我不希望rc
的值发生变化。
CWnd* pWnd = GetDlgItem(IDC_COMMENT_EDIT);
if (pWnd != NULL)
{
RECT rc;
pWnd->GetClientRect(&rc);
pWnd->MoveWindow(&rc, TRUE);
pWnd->GetClientRect(&rc);
}
rc.top
和rc.left
一如预期,一直为0
。
但是:在第一次调用
GetClientRect
之后,我得到rc.bottom == 52
和rc.right == 575
。在第二次调用
GetClientRect
之后,我得到rc.bottom == 48
和rc.right == 571
。请问有人知道发生了什么吗?