您的位置:首页 > 其它

MFC禁用关闭按钮、最小化、最大化

2013-03-30 01:35 246 查看
禁用关闭按钮

BOOL TestResultText::OnInitDialog()
{
CDialog::OnInitDialog();

// TODO: Add extra initialization here
::EnableMenuItem(::GetSystemMenu(this->m_hWnd, false), SC_CLOSE, MF_BYCOMMAND | MF_GRAYED);//forbid close

return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}

禁用最小化、最大化
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.style&=~(WS_MAXIMIZEBOX|WS_MINIMIZEBOX);

return TRUE;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐