要创建只有客户区的窗口,主要是窗口框架创建前更改默认的窗口风格:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
if(cs.hMenu!=NULL)
{
::DestroyMenu(cs.hMenu);
cs.hMenu = NULL;
}
//去掉菜单栏
cs.x=100; //改变初始位置
cs.y=100;
cs.cx=642; //改变初始大小
cs.cy=482;
cs.style=WS_POPUP;//改变弹出风格,无标题栏
//cs.dwExStyle=WS_EX_ACCEPTFILES ;
return TRUE;
}
去掉工具栏只要把OnCreate函数中默认创建工具栏的代码注释掉进行了:
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -