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

来源:互联网 发布:linux创用户命令 编辑:程序博客网 时间:2024/04/28 20:21

禁用关闭按钮

BOOL TestResultText::OnInitDialog() {CDialog::OnInitDialog();// TODO: Add extra initialization here::EnableMenuItem(::GetSystemMenu(this->m_hWnd, false), SC_CLOSE, MF_BYCOMMAND | MF_GRAYED);//forbid closereturn 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 cscs.style&=~(WS_MAXIMIZEBOX|WS_MINIMIZEBOX); return TRUE;}


原创粉丝点击