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 » Wrong maximized window position with taskbar on left side Collapse All
Subject Author Date
Torsten Schucht Jun 21, 2010 - 8:20 AM

Dear Support,


I do have the same problem as described here:


http://www.prof-uis.com/prof-uis/tech-support/support-forum/maximized-bug-when-windows-taskbar-is-docked-to-left-edge-of-desktop-67426.aspx#@lt;/p>

I am using v2.89 with Win7. The problem occurs when I have docked the Windows Taskbar to the left of my desktop and have the Windows 7 Basic Style (no aero effects) activated. A customer reported the issue also for a Windows XP system.


In contrast to the above thread, I can see the incorrect maximization also with a single monitor setup.


I tested it with the MDIDOCVIEW-m.exe sample application. After the first minimize/restore the window is displayed at the top left corner of the desktop ’behind’ the taskbar. The width of the window seems to be correct, since there is the desktop visible on the right with the width of the taskbar.


Torsten


 


 


 

Technical Support Jun 22, 2010 - 1:27 PM

Thank you for reporting this issue. We are working on fix. We have the beta fix at this moment. Please update the source code for the following method:

bool CExtNcFrameImpl::NcFrameImpl_GetMinMaxInfo(
            LPMINMAXINFO pMMI
            ) const
{
            ASSERT( pMMI != NULL );
            if( ! NcFrameImpl_IsSupported() )
                        return false;
            if( NcFrameImpl_IsDwmBased() )
                        return true;
CWnd * pWndFrameImpl = const_cast < CWnd * > ( NcFrameImpl_GetFrameWindow() );
            if( ( pWndFrameImpl->GetStyle() & WS_CHILD ) == 0 )
            {
                        WINDOWPLACEMENT _wp;
                        ::memset( &_wp, 0, sizeof(WINDOWPLACEMENT) );
                        _wp.length = sizeof(WINDOWPLACEMENT);
                        CExtNcFrameImpl::stat_GetWindowPlacement( pWndFrameImpl->m_hWnd, _wp );

                        CRect rcBorders( 0, 0, 0, 1 );
                        CExtPaintManager::monitor_parms_t _mp;
//                      CExtPaintManager::stat_GetMonitorParms( _mp, pWndFrameImpl );
                        CExtPaintManager::stat_GetMonitorParms( _mp, _wp.rcNormalPosition );

                        if( _wp.showCmd == SW_SHOWMINIMIZED )
                        {
                                    pMMI->ptMaxPosition.x = _mp.m_rcWorkArea.left + rcBorders.left;
                                    pMMI->ptMaxPosition.y = _mp.m_rcWorkArea.top + rcBorders.top;
                        }
                        else
                        {
                                    pMMI->ptMaxPosition.x = 0 + rcBorders.left;
                                    pMMI->ptMaxPosition.y = 0 + rcBorders.top;
                        }
                        if( g_PaintManager.m_bIsWin98orLater || g_PaintManager.m_bIsWin2000orLater )
                        {
                                    CRect rcClip( -32767, -32767, +32767, +32767 ), rcInfo( 0, 0, 0, 0 );
                                    if( EnumDisplayMonitors( NULL, &rcClip, stat_CalcMaxResizingInfo, LPARAM(LPVOID(&rcInfo)) ) )
                                    {
                                                pMMI->ptMaxTrackSize.x = pMMI->ptMaxSize.x = rcInfo.Width();
                                                pMMI->ptMaxTrackSize.y = pMMI->ptMaxSize.y = rcInfo.Height();
                                    }
                        }

                        /*pMMI->ptMaxTrackSize.x =*/ pMMI->ptMaxSize.x = _mp.m_rcWorkArea.Width() - rcBorders.left - rcBorders.right;
                        /*pMMI->ptMaxTrackSize.y =*/ pMMI->ptMaxSize.y = _mp.m_rcWorkArea.Height() - rcBorders.top - rcBorders.bottom;
//TRACE2( "max-pos %d %d\r\n", pMMI->ptMaxPosition.x, pMMI->ptMaxPosition.y );
                        APPBARDATA _data;
                        ::memset( &_data, 0, sizeof(APPBARDATA) );
                        _data.cbSize = sizeof(APPBARDATA);
                        UINT nSHR = (UINT)::SHAppBarMessage( ABM_GETSTATE, &_data );
                        if( nSHR == (ABS_AUTOHIDE|ABS_ALWAYSONTOP) )
                        {
                                    nSHR = (UINT)::SHAppBarMessage( ABM_GETTASKBARPOS, &_data );
                                    if( nSHR == 1 )
                                    {
                                                switch(_data.uEdge)
                                                {
                                                case ABE_TOP:
                                                            pMMI->ptMaxPosition.y ++;
                                                            pMMI->ptMaxSize.y --;
                                                break;
                                                case ABE_BOTTOM:
                                                            pMMI->ptMaxSize.y --;
                                                break;
                                                case ABE_LEFT:
                                                            pMMI->ptMaxPosition.x ++;
                                                            pMMI->ptMaxSize.x --;
                                                break;
                                                case ABE_RIGHT:
                                                            pMMI->ptMaxSize.x --;
                                                break;
                                                }
                                    } // if( nSHR == 1 )
                        } // if( nSHR == (ABS_AUTOHIDE|ABS_ALWAYSONTOP) )
            } // if( ( pWndFrameImpl->GetStyle() & WS_CHILD ) == 0 )
            return true;
}