mfc-获取客户端大小

1
2
3
4
5
RECT rect;
::GetClientRect(this->m_hWndOwner, &rect);
int cxClient = rect.right - rect.left;
int cyClient = rect.bottom - rect.top; // 获得客户区高度
SetWindowPos(NULL, 0, 0, cxClient, cyClient, SWP_NOZORDER | SWP_NOSIZE);