1.获取pWnd在屏幕上的大小和位置,包括边框:
CRect rc;
pWnd->GetWindowRect(&rc);
2.获取pWnd的大小,不包括边框:
CRect rc;
pWnd->GetClientRect(&rc);
3.获取pWnd在父窗体上的大小和位置,包括边框:
CRect rc;
pWnd->GetWindowRect(&rc);
pWnd->GetParent()->ScreenToClient(&rc);
1.获取pWnd在屏幕上的大小和位置,包括边框:
CRect rc;
pWnd->GetWindowRect(&rc);
2.获取pWnd的大小,不包括边框:
CRect rc;
pWnd->GetClientRect(&rc);
3.获取pWnd在父窗体上的大小和位置,包括边框:
CRect rc;
pWnd->GetWindowRect(&rc);
pWnd->GetParent()->ScreenToClient(&rc);