1,创建单文档工程
2,用 ClassWizard 添加消息响应函数 PreCreateWindow(),添加以下内容:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.style = WS_POPUP; //使主窗口不可见
cs.dwExStyle |= WS_EX_TOOLWINDOW; //不显示任务按钮
return TRUE;
}