读书人

MFC基于对话框的Media Player怎么实现

发布时间: 2012-05-20 16:03:12 作者: rapoo

MFC基于对话框的Media Player如何实现全屏显示功能?
需求源代码,帮忙啊~~~~~

[解决办法]
试试下面这段代码

C/C++ code
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;} 

读书人网 >VC/MFC

热点推荐