void CMainFrame::OnMenuFullscreen() {//全屏幕显示的处理函数 RECT rectDesktop; WINDOWPLACEMENT wpNew; if (m_bFullScreen) {//全屏幕显示模式 //隐藏工具条和状态条 m_wndStatusBar.ShowWindow(SW_HIDE); m_wndToolBar.ShowWindow(SW_HIDE); //保存正常视图时的窗口位置信息以便恢复原来状态 GetWindowPlacement (&m_wpPrev); m_wpPrev.length = sizeof m_wpPrev; //调整RECT为新的窗口尺寸 ::GetWindowRect ( ::GetDesktopWindow(), &rectDesktop ); ::AdjustWindowRectEx(&rectDesktop, GetStyle(), TRUE, GetExStyle()); //保存RECT以便OnGetMinMaxInfo()使用 m_FullScreenWindowRect = rectDesktop; wpNew = m_wpPrev; wpNew.showCmd = SW_SHOWNORMAL; wpNew.rcNormalPosition = rectDesktop; //生成新的工具条 m_wndFullScreenBar=new CToolBar; if(!m_wndFullScreenBar->Create(this, CBRS_SIZE_DYNAMIC|CBRS_FLOATING) || !m_wndFullScreenBar->LoadToolBar(IDR_FULLSCREEN)) { TRACE0("Failed to create toolbar/n"); return; // fail to create } |