在mfc中,如何设置一个隐藏菜单栏,工具栏,状态栏,最大化、最小化、关闭按钮的窗体

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
 if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
  return -1;

 // 去掉标题栏
 /*
 if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
  | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
  !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))*/
 if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
  | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC))
 {
  TRACE0("Failed to create toolbar/n");
  return -1;      // fail to create
 }

 // 去掉状态栏
 /*
 if (!m_wndStatusBar.Create(this) ||
  !m_wndStatusBar.SetIndicators(indicators,
    sizeof(indicators)/sizeof(UINT)))
 {
  TRACE0("Failed to create status bar/n");
  return -1;      // fail to create
 }*/

 // TODO: Delete these three lines if you don't want the toolbar to
 //  be dockable

 m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
 EnableDocking(CBRS_ALIGN_ANY);
 DockControlBar(&m_wndToolBar);

 // 设置标题--标题显示为:无标题-天志的导航
 //this->SetTitle("天志的导航");


 // 隐藏最大化,最小化,关闭按钮
 ModifyStyle(WS_SYSMENU, 0);


// 隐藏标题栏
 ModifyStyle(WS_CAPTION, 0);

 // 去掉菜单栏
 SetMenu(NULL);

 // 全屏显示
 RECT rc;
 ::GetWindowRect(::GetDesktopWindow(), &rc); 
 this->MoveWindow(&rc);

 return 0;

 

去掉标题栏:
在OnCreate函数中,添加如下代码:
ModifyStyle(WS_CAPTION, 0, SWP_FRAMECHANGED);

单文档,多文档中都是如此

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/xumingxsh/archive/2008/01/23/2061389.aspx

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值