我正在为 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
。
有谁知道发生了什么?