微软的DSOFramer控件本身没有全屏功能,我实现了全屏功能,但是有个问题,在C/S模式下调用的时候很完美,在IE下调用有问题,情况是全屏后压缩到左上方,大小和IE当前大小一致,应该是IE拦截了控件的消息,看谁又办法解决呢?已经郁闷了好几天了!

解决方案 »

  1.   

    直接把这控件放到一个在ActiveX控件的对话框中动态改变对话框的窗口属性为child或popup,当想全屏时,就把对话框设置为popup,然后父子窗口拉伸到屏幕大小,非全屏时就把窗口属性改为child
      

  2.   

    今天突然灵感一动解决了问题!用如下代码可以实现:
    void CDsoFramerControl::SetFullScreen()
    {
    m_isSetFullScreen=FALSE;
    if (!this->m_IsFull)
    {
    m_parent_hwnd=GetParent(m_hwnd);
    m_hwnd_ie=GetIEHwnd(m_hwnd);
    GetWindowRect(m_hwnd,&m_last_rect);
    GetWindowRect(m_parent_hwnd,&m_parent_rect);
    RECT rectDesktop,ierect;
    ::GetWindowRect ( m_hwnd_ie, &ierect );
    ::GetWindowRect ( ::GetDesktopWindow(), &rectDesktop );
    int cx = rectDesktop.right;
    int cy = rectDesktop.bottom;
    m_Size.cx=rectDesktop.right;
    m_Size.cy=rectDesktop.bottom;
    SetWindowText(m_hwnd_full_btn,"返回");
    HRGN rgn=CreateRectRgn(0,0,cx,cy);
    SetWindowRgn(m_hwnd,rgn,0);
    ::SetParent(m_hwnd,::GetDesktopWindow());
       ::SetWindowPos(this->m_hwnd,HWND_TOPMOST,
      0,-24,cx,cy, 
      SWP_ASYNCWINDOWPOS|SWP_NOCOPYBITS);
       ::MoveWindow(this->m_hwnd, 
      0,-24,cx,cy, 
      0);
    m_IsFull=TRUE;
    }
    else
    {
    SetParent(m_hwnd,m_parent_hwnd);
    int cx = m_last_rect.right-m_last_rect.left; 
    int cy = m_last_rect.bottom-m_last_rect.top;
    m_Size.cx=cx;
    m_Size.cy=cy;
    ::MoveWindow(this->m_hwnd, m_last_rect.left-m_parent_rect.left,m_last_rect.top-m_parent_rect.top, 
    cx,cy, 0);//this->
    ::SetWindowPos(this->m_hwnd,HWND_TOPMOST,
     m_last_rect.left-m_parent_rect.left,m_last_rect.top-m_parent_rect.top,cx,cy,
    SWP_ASYNCWINDOWPOS|SWP_NOCOPYBITS); 
    SetWindowText(m_hwnd_full_btn,"全屏");
    }
      

  3.   

    虽然用 fishion 提供的方法没有解决,仍然谢谢你!