Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » FullScreen View problem Collapse All
Subject Author Date
Gunasekaran Velu Jan 18, 2007 - 10:12 PM

Hi folks

i want try to get full screen view in my application. i am using same code whatever in the fullscreenstate sample application but i did not get the fullscreen view.


// code
void CMainFrame::_DoViewFullScreen( bool bSavePrevLayout )
{
    if( CExtPopupMenuWnd::g_bFullScreenMode )
    {
        CExtPopupMenuWnd::g_bFullScreenMode = false;
        if( bSavePrevLayout )
        {
            VERIFY( _DoBarStateSerialization(true,true) );
        }
        SetWindowPlacement( &m_wpSavedBeforeFullScreen );
        VERIFY( _DoBarStateSerialization(false,false) );
    } // if( CExtPopupMenuWnd::g_bFullScreenMode )
    else
    {
        m_wpSavedBeforeFullScreen.length = sizeof(WINDOWPLACEMENT);
        GetWindowPlacement( &m_wpSavedBeforeFullScreen );

        CRect rcDesktop;
        ::GetWindowRect( ::GetDesktopWindow(), &rcDesktop );
//         CExtPaintManager::monitor_parms_t _mp;
//         CExtPaintManager::stat_GetMonitorParms( _mp, m_hWnd );
//         rcDesktop = _mp.m_rcMonitor;

        CRect rcMdiClient;
        GetClientRect( &rcMdiClient );
        ClientToScreen( &rcMdiClient );
        CRect rcMdiFrame;
        GetWindowRect( &rcMdiFrame );
        rcMdiFrame.InflateRect(
            rcMdiClient.left-rcDesktop.left,
            rcMdiClient.top-rcDesktop.top,
            rcDesktop.right-rcMdiClient.right,
            rcDesktop.bottom-rcMdiClient.bottom
            );
        WINDOWPLACEMENT wpFullScreen;
        ::memcpy( &wpFullScreen, &m_wpSavedBeforeFullScreen, sizeof(WINDOWPLACEMENT) );
        wpFullScreen.showCmd = SW_SHOWNORMAL;
#if (defined __REMOVE_THIN_FULLSCREEN_BORDER)
        CSize _sizeFrameBorder(
            ::GetSystemMetrics(SM_CXFIXEDFRAME)-1,
            ::GetSystemMetrics(SM_CYFIXEDFRAME)-1
            );
        rcMdiFrame.InflateRect( _sizeFrameBorder );
#endif // (defined __REMOVE_THIN_FULLSCREEN_BORDER)
        wpFullScreen.rcNormalPosition = rcMdiFrame;
        wpFullScreen.ptMaxPosition = rcMdiFrame.TopLeft();
        m_sizeFullScreenDesktopDifference =
            rcMdiFrame.Size() - rcDesktop.Size();
        CExtPopupMenuWnd::g_bFullScreenMode = true;
        if( bSavePrevLayout )
        {
            VERIFY( _DoBarStateSerialization(false,true) );
        }
        SetWindowPlacement( &wpFullScreen );
        VERIFY( _DoBarStateSerialization(true,false) );
    } // else from if( CExtPopupMenuWnd::g_bFullScreenMode )
}
bool CMainFrame::_DoBarStateSerialization(
    bool bFullScreenState,
    bool bSaveState,
    bool bInitialLoad // = false
    )
{
CWinApp * pApp = ::AfxGetApp();
    ASSERT( pApp != NULL );
    ASSERT( pApp->m_pszRegistryKey != NULL );
    ASSERT( pApp->m_pszRegistryKey[0] != _T(’\0’) );
    ASSERT( pApp->m_pszProfileName != NULL );
    ASSERT( pApp->m_pszProfileName[0] != _T(’\0’) );
CString sSpan = pApp->m_pszProfileName;
    sSpan += _T("\\");
    sSpan +=
        bFullScreenState
            ? _T("BarPos-FullScreen")
            : _T("BarPos-Normal")
            ;
    RecalcLayout();
bool bRetVal = false;
    if( bSaveState )
        bRetVal =
            CExtControlBar::ProfileBarStateSave(
                this,
                pApp->m_pszRegistryKey,
                pApp->m_pszProfileName,
                (LPCTSTR)sSpan
                );
    else
    {
        bRetVal =
            CExtControlBar::ProfileBarStateLoad(
                this,
                pApp->m_pszRegistryKey,
                pApp->m_pszProfileName,
                (LPCTSTR)sSpan,
                &m_wpInitial
                );
    }
    if( !bSaveState )
    {
        bRetVal=true;
        if( !bRetVal )
        {
            _DoInitialDock( bFullScreenState );
            bRetVal = true;
        } // if( !bRetVal )
        else if( (!bInitialLoad) && (!CExtPopupMenuWnd::g_bFullScreenMode) )
        {
            ActivateFrame( m_wpInitial.showCmd );
            RedrawWindow( NULL, NULL,
                RDW_INVALIDATE|RDW_UPDATENOW
                    |RDW_ERASE|RDW_ERASENOW
                    |RDW_FRAME|RDW_ALLCHILDREN
                );
        } // else if( (!bInitialLoad) && (!CExtPopupMenuWnd::g_bFullScreenMode) )
        if( !bInitialLoad )
            m_wpInitial.showCmd = SW_HIDE;
    } // if( !bSaveState )
    return bRetVal;//return 0;
}
void CMainFrame::_DoInitialDock(bool bFullScreenState)
{
    if( bFullScreenState )
    {
        CRect wrAlreadyDockedBar;
        DockControlBar(&m_wndMenuBar);
        DockControlBar(&m_wndToolBar);
        
        DockControlBar(&m_wndToolBar1,AFX_IDW_DOCKBAR_LEFT);

        RecalcLayout();
        m_wndToolBar1.GetWindowRect( &wrAlreadyDockedBar );
        wrAlreadyDockedBar.OffsetRect( 0, 1 );
        DockControlBar(&m_wndToolBar,AFX_IDW_DOCKBAR_LEFT,&wrAlreadyDockedBar);
        
        RecalcLayout();
    
        RecalcLayout();
        static CSize
            _sizeInitH( 250, 100 ),
            _sizeInitV( 100, 250 ),
            _sizeInitF( 250, 250 );
        m_wndResizableBarDlg.SetInitDesiredSizeHorizontal( _sizeInitH );
        m_wndResizableBarDlg.SetInitDesiredSizeVertical( _sizeInitV );
        m_wndResizableBarDlg.SetInitDesiredSizeFloating( _sizeInitF );
        m_wndResizableBarDlg1.SetInitDesiredSizeHorizontal( _sizeInitH );
        m_wndResizableBarDlg1.SetInitDesiredSizeVertical( _sizeInitV );
        m_wndResizableBarDlg1.SetInitDesiredSizeFloating( _sizeInitF );
        m_wndResizableBarDlg2.SetInitDesiredSizeHorizontal( _sizeInitH );
        m_wndResizableBarDlg2.SetInitDesiredSizeVertical( _sizeInitV );
        m_wndResizableBarDlg2.SetInitDesiredSizeFloating( _sizeInitF );
        m_wndResizableBarDlg4.SetInitDesiredSizeHorizontal( _sizeInitH );
        m_wndResizableBarDlg4.SetInitDesiredSizeVertical( _sizeInitV );
        m_wndResizableBarDlg4.SetInitDesiredSizeFloating( _sizeInitF );
        m_wndResizableBarDlg7.SetInitDesiredSizeHorizontal( _sizeInitH );
        m_wndResizableBarDlg7.SetInitDesiredSizeVertical( _sizeInitV );
        m_wndResizableBarDlg7.SetInitDesiredSizeFloating( _sizeInitF );
        m_wndResizableBarDlg.DockControlBar(AFX_IDW_DOCKBAR_RIGHT, 1,this);
        m_wndResizableBarDlg1.DockControlBar(AFX_IDW_DOCKBAR_BOTTOM,2,this);
        m_wndResizableBarDlg2.DockControlBar(AFX_IDW_DOCKBAR_RIGHT, 3,this);
        m_wndResizableBarDlg4.DockControlBar(AFX_IDW_DOCKBAR_RIGHT, 5,this);
        m_wndResizableBarDlg7.DockControlBar(AFX_IDW_DOCKBAR_BOTTOM,6,this);

        ShowControlBar(&m_wndStatusBar,FALSE,TRUE);
        ShowControlBar(&m_wndMenuBar,FALSE,TRUE);
        ShowControlBar(&m_wndToolBar,FALSE,TRUE);
        ShowControlBar(&m_wndToolBar1,FALSE,TRUE);
        ShowControlBar(&m_wndResizableBarDlg,FALSE,TRUE);
        ShowControlBar(&m_wndResizableBarDlg1,FALSE,TRUE);
        ShowControlBar(&m_wndResizableBarDlg2,FALSE,TRUE);
        ShowControlBar(&m_wndResizableBarDlg4,FALSE,TRUE);
        ShowControlBar(&m_wndResizableBarDlg7,FALSE,TRUE);
        RecalcLayout();
    } // if( bFullScreenState )
    else
    {
        CRect wrAlreadyDockedBar;
        DockControlBar(&m_wndMenuBar);
        DockControlBar(&m_wndToolBar);
        
        RecalcLayout();
        m_wndToolBar.GetWindowRect( &wrAlreadyDockedBar );
        wrAlreadyDockedBar.OffsetRect( 1, 0 );
        DockControlBar(&m_wndToolBar1,AFX_IDW_DOCKBAR_TOP,&wrAlreadyDockedBar);

        RecalcLayout();
        m_wndToolBar1.GetWindowRect( &wrAlreadyDockedBar );
        wrAlreadyDockedBar.OffsetRect( 1, 0 );
        DockControlBar(&m_wndToolBar,AFX_IDW_DOCKBAR_TOP,&wrAlreadyDockedBar);
        
        RecalcLayout();
        
        RecalcLayout();
        static CSize
            _sizeInitH( 250, 100 ),
            _sizeInitV( 100, 250 ),
            _sizeInitF( 250, 250 );
        m_wndResizableBarDlg.SetInitDesiredSizeHorizontal( _sizeInitH );
        m_wndResizableBarDlg.SetInitDesiredSizeVertical( _sizeInitV );
        m_wndResizableBarDlg.SetInitDesiredSizeFloating( _sizeInitF );
        m_wndResizableBarDlg1.SetInitDesiredSizeHorizontal( _sizeInitH );
        m_wndResizableBarDlg1.SetInitDesiredSizeVertical( _sizeInitV );
        m_wndResizableBarDlg1.SetInitDesiredSizeFloating( _sizeInitF );
        m_wndResizableBarDlg2.SetInitDesiredSizeHorizontal( _sizeInitH );
        m_wndResizableBarDlg2.SetInitDesiredSizeVertical( _sizeInitV );
        m_wndResizableBarDlg2.SetInitDesiredSizeFloating( _sizeInitF );
        m_wndResizableBarDlg4.SetInitDesiredSizeHorizontal( _sizeInitH );
        m_wndResizableBarDlg4.SetInitDesiredSizeVertical( _sizeInitV );
        m_wndResizableBarDlg4.SetInitDesiredSizeFloating( _sizeInitF );
        m_wndResizableBarDlg7.SetInitDesiredSizeHorizontal( _sizeInitH );
        m_wndResizableBarDlg7.SetInitDesiredSizeVertical( _sizeInitV );
        m_wndResizableBarDlg7.SetInitDesiredSizeFloating( _sizeInitF );
        m_wndResizableBarDlg.DockControlBar(AFX_IDW_DOCKBAR_LEFT,1,this,false);
        m_wndResizableBarDlg1.DockControlBar(&m_wndResizableBarDlg1,true,true);
        m_wndResizableBarDlg2.DockControlBar(AFX_IDW_DOCKBAR_RIGHT,1,this,false);
        m_wndResizableBarDlg2.DockControlBar(&m_wndResizableBarDlg2,false,true);
        m_wndResizableBarDlg2.GetParentFrame()->RecalcLayout();
        m_wndResizableBarDlg4.DockControlBar(&m_wndResizableBarDlg4,false,true);
        RecalcLayout();
    } // else from if( bFullScreenState )
    
}
void CMainFrame::OnUpdateViewFullScreen(CCmdUI* pCmdUI)
{
    pCmdUI->SetCheck( CExtPopupMenuWnd::g_bFullScreenMode );
}
void CMainFrame::_DoFullScreenGetMinMaxInfo( LPMINMAXINFO lpMMI )
{
    ASSERT( CExtPopupMenuWnd::g_bFullScreenMode );

    CRect rcDesktop;
        ::GetWindowRect( ::GetDesktopWindow(), &rcDesktop );
    //     CExtPaintManager::monitor_parms_t _mp;
    //     CExtPaintManager::stat_GetMonitorParms( _mp, m_hWnd );
    //     rcDesktop = _mp.m_rcMonitor;

    #if (defined __REMOVE_THIN_FULLSCREEN_BORDER)
    CSize _sizeFrameBorder(
            ::GetSystemMetrics(SM_CXFIXEDFRAME)-1,
            ::GetSystemMetrics(SM_CYFIXEDFRAME)-1
            );
    #endif // (defined __REMOVE_THIN_FULLSCREEN_BORDER)
    CSize _size =
            rcDesktop.Size()
            + m_sizeFullScreenDesktopDifference
    #if (defined __REMOVE_THIN_FULLSCREEN_BORDER)
            + _sizeFrameBorder + _sizeFrameBorder
    #endif // (defined __REMOVE_THIN_FULLSCREEN_BORDER)
            ;
        lpMMI->ptMaxSize.x = _size.cx;
        lpMMI->ptMaxSize.y = _size.cy;
        lpMMI->ptMaxTrackSize.x = _size.cx;
        lpMMI->ptMaxTrackSize.y = _size.cy;
}
void CMainFrame::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
{
    if( CExtPopupMenuWnd::g_bFullScreenMode )
        _DoFullScreenGetMinMaxInfo( lpMMI );
    else
        CMDIFrameWnd::OnGetMinMaxInfo( lpMMI );
}

Technical Support Jan 19, 2007 - 5:01 AM

Did you try to clean the registry settings of your application before running the full-screen-able version for the first time?
You can also send us a stripped version of your project so we can clarify what’s wrong.

Gunasekaran Velu Jan 22, 2007 - 3:21 AM



hi


its so big(size) i can’t able to send that.. if u don’t mind can u help me... i clear the registry and try it again but no use...

Thanks
Guna

Technical Support Jan 22, 2007 - 12:12 PM

We are not asking you to send us for the entire source code. Could you create a copy of your project which contains only UI part only and remove any dependencies from any other project parts? Typically this does not require too much time. Or you can send us any other test project that demonstrates what’s wrong.