MFC基于对话框的Media Player如何实现全屏显示功能?
需求源代码,帮忙啊~~~~~
[解决办法]
试试下面这段代码
BOOL CPlay::SwitchFullScreen(BOOL bFullScreen){ CWnd* parentWnd = this->GetParent(); if ( NULL == m_ParentWnd && parentWnd != this->GetDesktopWindow()) { m_ParentWnd = parentWnd; } if (bFullScreen) { this->SetParent(NULL); ::SetWindowPos(this->GetSafeHwnd(), HWND_TOPMOST,-1,-1,-1,-1, SWP_NOMOVE|SWP_NOSIZE); this->ShowWindow(SW_MAXIMIZE); } else { this->ShowWindow(SW_RESTORE); ::SetWindowPos(this->GetSafeHwnd(), HWND_TOPMOST,-1,-1,-1,-1,SWP_NOMOVE|SWP_NOSIZE); CRect parentBounds; m_ParentWnd->GetClientRect(parentBounds); this->SetParent(m_ParentWnd); this->MoveWindow(parentBounds); } bFullScreen = !bFullScreen; return bFullScreen;}