恩 最近在找可以把MFC中SDI的title bar弄掉的方法
找到這個應該可以用,不過....感覺有點暴力觧法
唉 反正可以用就好
From http://www.tek-tips.com/index.cfm
===========================
someTimeOnly (TechnicalUser) 24 Mar 04 17:57
I found an MSDN article
“HOWTO: Create MFC Applications that Do Not Have a Menu
Bar”
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs){
if(cs.hMenu!=NULL){
::DestroyMenu(cs.hMenu); // delete menu if loaded
cs.hMenu = NULL; // no menu for this window
}
return CFrameWnd::PreCreateWindow(cs);
}
and I also found somewhere on net how to avoid document name with the application name in the title bar by adding
cs.style &= ~FWS_ADDTOTITLE;
afterward I applied
cs.style &= ~WS_SYSMENU;
cs.style &= ~WS_THICKFRAME;
cs.style &= ~WS_SYSMENU;
cs.style &= ~WS_MINIMIZEBOX
cs.style &= ~WS_MAXIMIZEBOX
and got desired results.
Now one thing is still missing
I don’t want to see title bar at all.
HRGN hRgn=CreateRectRgn(0,30,650,650);//I don’t like these
// hrd coded values
m_pMainWnd->SetWindowRgn(hRgn,true);
This makes title bar to be washed away but my application is not covering the whole screen. Help me out with this problem.

創作者介紹
創作者 Green Wind 的頭像
eager

Green Wind

eager 發表在 痞客邦 留言(0) 人氣( 110 )