要windows 的工具栏看不见才行

解决方案 »

  1.   

    WINDOWPLACEMENT wpNew;

    if (!IsFullScreen())
    {
    // We'll need these to restore the original state.
    m_wpPrev.length = sizeof(m_wpPrev);
    GetWindowPlacement(&m_wpPrev);

    if (m_pMDClientView == NULL)
    return; CRect rectDesktop, rectFrame, rectView; // Adjust RECT to new size of window
    VERIFY(::GetWindowRect(::GetDesktopWindow(), &rectDesktop));
    GetWindowRect(&rectFrame);
    CView *pVideoView = m_pMDClientView->GetPage(2);
    //m_pMDClientView->GetWindowRect(&rectView);
    pVideoView->GetWindowRect(&rectView);
    rectFrame.InflateRect(rectView.left - rectDesktop.left, rectView.top - rectDesktop.top,
     rectDesktop.right-rectView.right, rectDesktop.bottom-rectView.bottom);

    m_rectFullScreenWindow = rectFrame;

    wpNew = m_wpPrev;
    wpNew.showCmd = SW_SHOWNORMAL;
    wpNew.rcNormalPosition = rectFrame;

    m_pwndFullScreenBar = new CBCGPToolBar;

    if (!m_pwndFullScreenBar->Create(this))
    {
                TRACE0("Failed to create toolbar\n");
    return;      // fail to create
    }

    //don't allow the toolbar to dock
    CBCGPToolbarButton button(ID_FULLSCREEN_VIEW, -1, _T("关闭全屏"), FALSE, TRUE);
    m_pwndFullScreenBar->InsertButton(button);
    m_pwndFullScreenBar->EnableDocking(0);
    m_pwndFullScreenBar->SetWindowPos(0, 100, 100, 100, 100, SWP_NOZORDER | SWP_NOACTIVATE | SWP_SHOWWINDOW);
    m_pwndFullScreenBar->SetWindowText(_T("全屏"));
    m_pwndFullScreenBar->FloatControlBar(CRect(100, 100, 200, 200));
    m_bFullScreen = TRUE;
    }
    else
    {
    // Destroy the toolbar
    CWnd *pWnd = m_pwndFullScreenBar->GetParentMiniFrame();
    if (pWnd == NULL)
    pWnd = m_pwndFullScreenBar;
    VERIFY(pWnd->DestroyWindow());
    delete m_pwndFullScreenBar;
    m_pwndFullScreenBar = NULL;

    m_bFullScreen = FALSE;

    { // This is a workaround to prevent the toolbars from being broken
    // into different rows, when the window is maximized and
    // the restored position is too small.
    WINDOWPLACEMENT wpNew(m_wpPrev);
    VERIFY(::CopyRect(&wpNew.rcNormalPosition, &m_rectFullScreenWindow));
    VERIFY(SetWindowPlacement(&wpNew));
    } wpNew = m_wpPrev;
    }

    VERIFY(SetWindowPlacement(&wpNew));
    参看上面的代码
      

  2.   

    在InitInstance()函数中将
    m_pMainWnd->ShowWindow(SW_SHOW);
    改成
    m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
    你的程序的界面就能最大化显示了!
      

  3.   

    DEVMODE DevMode;
    DevMode.dmSize = sizeof(DEVMODE);
    DevMode.dmDriverExtra = 0;
    EnumDisplaySettings(NULL,ENUM_CURRENT_SETTINGS,&DevMode);
    ::SetWindowPos (m_hWnd, (HWND)NULL,0,0,
                   DevMode.dmPelsWidth,DevMode.dmPelsHeight,SWP_NOMOVE|SWP_NOZORDER);
    对话框的
      

  4.   

    窗口的风格为WS_POPUP,大小为整个屏幕,
    不要使用其它的风格,如层叠式窗口风格,标题栏等
    可以参看<<Windows图形编程>>第一章中的一个例子,一位博干士写的
    这是一本好书哦,快去买了收藏
      

  5.   

    在InitInstance()函数中将
    m_pMainWnd->ShowWindow(SW_SHOW);
    改成
    m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
    你的程序的界面就能最大化显示了!vcforever(霓裳羽衣) 说得对,够简洁
      

  6.   

    ChangeDisplaySettings(&dmScreenSettings,CDS_FULLSCREEN);可以搞定
      

  7.   

    create窗口有个样式参数,你查一下资料,应该可以搞定