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;
}