对话框全屏

来源:互联网 发布:spark源码pdf 编辑:程序博客网 时间:2024/06/10 23:37

m_bFullScreen=!m_bFullScreen; // 设置全屏显示标志

 //一种更好的全屏显示
 LONG style = ::GetWindowLong(this->m_hWnd,GWL_STYLE);
 if(m_bFullScreen)//全屏显示
 {
  style &= ~(WS_DLGFRAME | WS_THICKFRAME);
  SetWindowLong(this->m_hWnd,GWL_STYLE, style);
  this->ShowWindow(SW_SHOWMAXIMIZED);
  CRect rect;
  this->GetWindowRect(&rect);
  ::SetWindowPos(this->m_hWnd,HWND_NOTOPMOST,rect.left-1, rect.top-1, rect.right-rect.left + 3, rect.bottom-rect.top + 3, SWP_FRAMECHANGED);
 }
 else
 {
  style |= WS_DLGFRAME | WS_THICKFRAME;
  SetWindowLong(this->m_hWnd, GWL_STYLE, style);
  this->ShowWindow(SW_NORMAL);
 }