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))
{
TRACE0("Failed to create toolbar/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