正在阅读:为MFC应用程序添全屏幕显示功能为MFC应用程序添全屏幕显示功能

2004-11-05 10:06 出处:PConline 作者:i_like_cpp 责任编辑:linjixiong


  //不允许工具条停泊
  m_wndFullScreenBar->EnableDocking(FALSE);
  m_wndFullScreenBar->SetWindowPos(0,100,100,0,0,SWP_NOSIZE
  |SWP_NOZORDER|SWP_NOACTIVATE|SWP_SHOWWINDOW);
  m_wndFullScreenBar->SetWindowText(_T("全屏幕显示"));
  FloatControlBar(m_wndFullScreenBar, CPoint(100,100));
  m_bFullScreen=TRUE;
  }
  else
  {//正常显示模式
  //删除全屏幕工具条
  m_wndFullScreenBar->DestroyWindow();
  delete m_wndFullScreenBar;

  m_bFullScreen=FALSE;

  //恢复工具条和状态条
  m_wndStatusBar.ShowWindow(SW_SHOWNORMAL);
  m_wndToolBar.ShowWindow(SW_SHOWNORMAL);
  wpNew = m_wpPrev;
  }

  //设置窗口显示状态
  SetWindowPlacement ( &wpNew );
  }

  void CMainFrame::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
  {
  if (m_bFullScreen)
  {
  lpMMI->ptMaxSize.y = m_FullScreenWindowRect.Height();
  lpMMI->ptMaxTrackSize.y = lpMMI->ptMaxSize.y;
  lpMMI->ptMaxSize.x = m_FullScreenWindowRect.Width();
  lpMMI->ptMaxTrackSize.x = lpMMI->ptMaxSize.x;
  }
  }

  void CMainFrame::OnUpdateMenuFullscreen(CCmdUI* pCmdUI)
  {//更新菜单的状态
  pCmdUI->Enable();
  pCmdUI->SetCheck(m_bFullScreen);
  }


察看评论详细内容 我要发表评论
作者笔名 简短内容 发表时间
:
键盘也能翻页,试试“← →”键

相关文章

关注我们

最新资讯离线随时看 聊天吐槽赢奖品