calcWindowRect

来源:百度知道 编辑:UC知道 时间:2024/05/13 17:48:11
int CMainWindow::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
……
CRect rect(0,0,m_rc.right,m_rc.bottom);
CalcWindowRect(&rect);
SetWindowPos(NULL,0,0,rect.Width(),rect.Height(),
SWP_NOORDER | SWP_NOMOVE | SWP_NOREDRAW);
……
}
我想问一下上面的这两个函数怎么用的,是不是有重复了,请详细解释一下这两个函数使用先后的关系,为了达到什么目的,谢了。

没有重复啊。

CRect rect(0,0,m_rc.right,m_rc.bottom); 初始化rect
CalcWindowRect(&rect); 重新设置rect
SetWindowPos(NULL,0,0,rect.Width(),rect.Height(),
SWP_NOORDER | SWP_NOMOVE | SWP_NOREDRAW); 设置主窗体为rect大小,并且设置一些属性