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;
}
{
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);
单文档,多文档中都是如此