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 Tech Support » Main frame bug (not fixed since 2.87 version) Collapse All
Subject Author Date
Gevork Odabashyan Nov 24, 2010 - 5:57 AM

We reported about this bug on Dec 4, 2009:


www.prof-uis.com/prof-uis/tech-support/support-forum/task-main-frame-change-it-size-66378.aspx


Currently we have version 2.91 but the bug still not fixed.


To reproduced it we use CExtPaintManagerOffice2007_R1 or CExtPaintManagerOffice2007_Black skins.


The problem in the method:


bool CExtNcFrameImpl::NcFrameImpl_PreWindowProc( LRESULT & lResult, UINT message, WPARAM wParam, LPARAM lParam )


for WM_SETTINGCHANGE message.

Technical Support Nov 27, 2010 - 1:54 PM

The WM_SETTINGCHANGE handler code is not related to the discussed problem. The following version of it can proof this:

   case WM_SETTINGCHANGE:
                        NcFrameImpl_MapHtRects_Clean();
                        if( ! NcFrameImpl_IsSupported() )
                                    break;
                        if( NcFrameImpl_IsDwmBased() )
                                    break;
                        if( wParam == SPI_SETWORKAREA )
                        {
                                    POINT ptCursor;
                                    if( ::GetCursorPos( &ptCursor ) )
                                    { // this condition protects code inside it from screen-saver/logoff mode
                                                WINDOWPLACEMENT _wp;
                                                ::memset( &_wp, 0, sizeof(WINDOWPLACEMENT) );
                                                _wp.length = sizeof(WINDOWPLACEMENT);
                                                if( GetWindowPlacement( _wp ) && _wp.showCmd == SW_SHOWMAXIMIZED )
                                                {
                                                            CExtPaintManager::monitor_parms_t _mp;
                                                            CExtPaintManager::stat_GetMonitorParms( _mp, pWndFrameImpl );
                                                            WINDOWPLACEMENT _wpAdjust;
                                                            ::memcpy( &_wpAdjust, &_wp, sizeof(WINDOWPLACEMENT) );
                                                            _wpAdjust.showCmd = SW_SHOWNORMAL; // SW_RESTORE;
//                                                          pWndFrameImpl->GetWindowRect( &_wpAdjust.rcNormalPosition );
                                                            ::CopyRect( &_wpAdjust.rcNormalPosition, &_mp.m_rcWorkArea );
                                                            _wpAdjust.ptMaxPosition.x = _wpAdjust.ptMaxPosition.x = _wpAdjust.rcNormalPosition.left;
                                                            _wpAdjust.ptMaxPosition.y = _wpAdjust.ptMaxPosition.y = _wpAdjust.rcNormalPosition.top;
                                                            SetWindowPlacement( _wpAdjust );
                                                            SetWindowPlacement( _wp );
                                                            //NcFrameImpl_RecalcNcFrame();
afxDump << "changing window\r\n";
                                                } // this condition protects code inside it from screen-saver/logoff mode
else
afxDump << "window is not marked as maximized\r\n";
                                    }
else
afxDump << "no access to cursor position, desktop is invisible\r\n";
                        }
You will not see any messages in the VS Output window under debug session. But you will see the changing window message if you re-dock the Windows Task Bar to some other side of the desktop.
We improved the skinned non client window area support in Prof-UIS 2.91. You can see this during UI theme switching: the flicker and window jitter effects were removed. The problem you are reporting cannot be reproduced with Prof-UIS 2.91 on our computers. We checked Windows XP Professional with SP3 and latest updates, Windows Vista and Windows 7 with all latest updates.



Gevork Odabashyan Nov 29, 2010 - 9:10 AM

I used you code (it some differet fron v.2.91):


bool CMainFrame::NcFrameImpl_PreWindowProc( LRESULT & lResult, UINT message, WPARAM wParam, LPARAM lParam )

{

    if (message != WM_SETTINGCHANGE)

    {

        return CExtNCW::NcFrameImpl_PreWindowProc( lResult, message, wParam, lParam );

    }

    else

    {

        if( ! m_bNcFrameImpl_IsEnabled )

            return false;

        m_bNcFrameImpl_RestoreBorder = false;

        CWnd * pWndFrameImpl = NcFrameImpl_GetFrameWindow();

        switch( message )

        {

        case WM_SETTINGCHANGE:

             NcFrameImpl_MapHtRects_Clean();

            if( ! NcFrameImpl_IsSupported() )

                        break;

            if( NcFrameImpl_IsDwmBased() )

                        break;

            if( wParam == SPI_SETWORKAREA )

            {

                POINT ptCursor;

                if( ::GetCursorPos( &ptCursor ) )

                { // this condition protects code inside it from screen-saver/logoff mode

                    WINDOWPLACEMENT _wp;

                    ::memset( &_wp, 0, sizeof(WINDOWPLACEMENT) );

                    _wp.length = sizeof(WINDOWPLACEMENT);

                    if( CExtNcFrameImpl::GetWindowPlacement( _wp ) && _wp.showCmd == SW_SHOWMAXIMIZED )

                    {

                        CExtPaintManager::monitor_parms_t _mp;

                        CExtPaintManager::stat_GetMonitorParms( _mp, pWndFrameImpl );

                        WINDOWPLACEMENT _wpAdjust;

                        ::memcpy( &_wpAdjust, &_wp, sizeof(WINDOWPLACEMENT) );

                        _wpAdjust.showCmd = SW_SHOWNORMAL; // SW_RESTORE;

    //                  pWndFrameImpl->GetWindowRect( &_wpAdjust.rcNormalPosition );

                        ::CopyRect( &_wpAdjust.rcNormalPosition, &_mp.m_rcWorkArea );

                        _wpAdjust.ptMaxPosition.x = _wpAdjust.ptMaxPosition.x = _wpAdjust.rcNormalPosition.left;

                        _wpAdjust.ptMaxPosition.y = _wpAdjust.ptMaxPosition.y = _wpAdjust.rcNormalPosition.top;

                        CExtNcFrameImpl::SetWindowPlacement( _wpAdjust );

                        CExtNcFrameImpl::SetWindowPlacement( _wp );

                        //NcFrameImpl_RecalcNcFrame();

                        afxDump << "changing window\r\n";

                    } // this condition protects code inside it from screen-saver/logoff mode

                    else

                        afxDump << "window is not marked as maximized\r\n";

                }

                else

                    afxDump << "no access to cursor position, desktop is invisible\r\n";

            }

            break;

        } // switch( message )

    }

    return false;

}


and get the dump message in the VS Output window under debug session : changing window.


So The WM_SETTINGCHANGE handler code is related to the discussed problem.

Technical Support Dec 1, 2010 - 11:38 PM

Do you have any specific software based on system wide hooks which may affect this notification? Did you check this issue on more than one computer? We cannot reproduce it.

Gevork Odabashyan Dec 2, 2010 - 5:02 AM

No, we use standart Windows  XP SP3.

This bug is reproduced on a all computers with 2 monitors.

To reproduce this bug we use the next sequence:



1. Be sure that Windows task bar is in horizontal bottom position of the  default monitor (the 1st monitor).

2. Start your sample "FormulaGrid" and maximized it main frame on the default monitor (the 1st monitor).

  

Now Windows task bar and maximized "FormulaGrid" main frame is on the same default monitor (the 1st monitor).



3. Move the Windows task bar to the horizontal position (to the left or right side of the monitor).



You will see that the "FormulaGrid" frame will be change it size.

We find that the bug reproduced for ’CExtPaintManagerOffice2007_R1’ and ’CExtPaintManagerOffice2007_Black’ themes.

The same effect appears when you get the new e-mail message and new icon added to tray. This case is most  critical (but it reproduced not so stable as discribed one).

Gevork Odabashyan Dec 3, 2010 - 6:43 AM

Excuse me, the third step is incorrect:


Instead:


3. Move the Windows task bar to the horizontal position (to the left or right side of the monitor).


Must be:


3. Move the Windows task bar to the vertical position (to the left or right side of the monitor).