怎样创建一个不带标题栏,工具栏,状态栏以及菜单栏的窗口

解决方案 »

  1.   

    int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
    {
    this->ModifyStyle(WS_CAPTION,0);
    this->ModifyStyle(WS_THICKFRAME,0);
    this->SetMenu(NULL);
    this->m_wndToolBar.ShowWindow(SW_HIDE); 
    this->m_wndStatusBar.ShowWindow(SW_HIDE);
    this->ShowWindow(SW_MAXIMIZE);
    CWnd *wnd=this->FindWindow("Shell_TrayWnd",NULL);
    wnd->ShowWindow(FALSE);
             .......;
    }
      

  2.   

    建立一个单文档应用程序,在CMainFrame::OnCreate加入如下语句,
    SetMenu(NULL);
    另外注释掉工具栏和状态栏创建的语句;你重载WM_WINDOWPOSCHANGING消息,加入下面代码
    void CMainFrame::OnWindowPosChanging(WINDOWPOS* lpwndpos)
    {
    CFrameWnd::OnWindowPosChanging(lpwndpos); ::SetWindowLong(m_hWnd, GWL_STYLE, 
    ::GetWindowLong(m_hWnd, GWL_STYLE) & 
    (~WS_CAPTION )); 
    }