需求源代码,帮忙啊~~~~~

解决方案 »

  1.   

    试试下面这段代码
    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;
    }
      

  2.   

    回复wtbike:
    BOOL CPlay::SwitchFullScreen(BOOL bFullScreen)这个函数是哪的函数啊,我想通过一个button来实现播放器的全屏播放,应该如何?
      

  3.   

    你在button的响应函数中调用SwitchFullScreen就可以了呀
      

  4.   

    我在button的函数中加入了一条命令,m_player.setfullscreen(true);就可以实现全屏,但问题是我如何按Esc退出全屏啊?
      

  5.   


    在按“Esc”的时候有鼠标消息的,你可以获取,在这里调用setfullscreen(flase)就可以了