Crazy_Challenger

导航

 

void CMainFrame::OnSize(UINT nType, int cx, int cy)
{
CFrameWnd::OnSize(nType, cx, cy);
RECT rc;

m_wndStatusBar.GetItemRect(0, &rc);

// Reposition the progress control correctly!

// m_progress.SetWindowPos(&wndTop, rc.left, rc.top, rc.right - rc.left,
//
// rc.bottom - rc.top, 0);
// TODO: Add your message handler code here
//::SetWindowPos(this->m_hWnd,HWND_TOP,0,0,790,560,SWP_NOZORDER); 指定区域
::MoveWindow(this->m_hWnd,0,0,::GetSystemMetrics(SM_CXSCREEN),::GetSystemMetrics(SM_CYSCREEN),true);//全屏显示
CenterWindow();
}

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
// cs.cx=GetSystemMetrics(SM_CXSCREEN);
// cs.cy=GetSystemMetrics(SM_CYSCREEN);
// cs.cx=1000;
// cs.cy=600;
// cs.x =0;
// cs.y =0;
//禁止改变拖动改变窗体大小
cs.cx = ::GetSystemMetrics(SM_CXSCREEN);//810;;
cs.cy = ::GetSystemMetrics(SM_CYSCREEN);//620;
cs.hMenu =NULL;
cs.style &= ~WS_THICKFRAME; //去掉可改变大小的边框
cs.style |= WS_DLGFRAME; //增加不能改变大小的边框
cs.style &= ~WS_MAXIMIZEBOX; //去掉最大化

return TRUE;
}

以上两个位置都可以,PreCreateWindow在前执行,OnSize在后执行

posted on 2019-07-11 09:36  Crazy_Challenger  阅读(286)  评论(0)    收藏  举报