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 » CExtListCtrl control flicker issue Collapse All
Subject Author Date
Dominik Braendlin Jun 25, 2010 - 5:28 AM

Dear Tech Support,

I have an issue with the CExtListCtrl control. You can easily reproduce it while running the v2.90 Prof-UIS Controls Demo (Release UNICODE with MFC DLL). Go to the shell browser and grab the e.g. “Type” header and start to make it bigger or smaller. You will notice that the app itself and other apps such as MS Outlook start to flicker. If you hold the mouse pressed but steady the flickering does not stop. If you check with Spy ++ you see that there are lots of messages. If you do the same thing with a CListCtrl control there is no flickering and also no messages while keeping the mouse pressed but steady after resizing a header item.

Thanks

Adrian

 

Technical Support Jun 25, 2010 - 11:51 AM

Thank you for posting this issue. We prepared a beta fix. Please update the source code for the following method:

void CExtHeaderCtrl::OnMouseMove( UINT nFlags, CPoint point )
{
            ASSERT_VALID( this );
//          CHeaderCtrl::OnMouseMove( nFlags, point );
            nFlags;
            if( m_nPressingColNo >= 0 )
            {
                        CExtPopupMenuTipWnd * pATTW = OnAdvancedPopupMenuTipWndGet();
                        if( pATTW != NULL )
                                    pATTW->Hide();
                        if( m_bOnDividerAtRight )
                        {
                                    CPoint ptScreenPressing = point;
                                    ClientToScreen( &ptScreenPressing );
                                    INT nExtent = ptScreenPressing.x - m_ptScreenPressing.x + m_nHelperInitialResizingExtent;
                                    HeaderItemExtentSet( m_nPressingColNo, nExtent );
                                    _DoSetCursor();
                                    if( m_bOnDividerAtRight )
                                    {
                                                HWND hWndParent = ::GetParent( m_hWnd );
                                                if( hWndParent != NULL )
                                                {
                                                            UINT nOwnID = UINT( GetDlgCtrlID() );
                                                            HD_NOTIFY _data, _data2;
                                                            ::memset( &_data, 0, sizeof(HD_NOTIFY) );
                                                            ::memset( &_data2, 0, sizeof(HD_NOTIFY) );
                                                            _data.hdr.hwndFrom = m_hWnd;
                                                            _data.hdr.idFrom = nOwnID;
                                                            _data.iButton = 0;
                                                            _data.iItem = m_nPressingColNo; // nColNo;
                                                            _data.hdr.code = HDN_TRACK;
HDITEM hdItemBuffer; // to avoid common controls crashing
::memset( &hdItemBuffer, 0, sizeof(HDITEM) );
hdItemBuffer.mask = HDI_WIDTH;
hdItemBuffer.cxy = nExtent;
_data.pitem = &hdItemBuffer;
                                                            ::memcpy( &_data2, &_data, sizeof(HD_NOTIFY) );
//#if (defined _UNICODE)
//                                                          ::LockWindowUpdate( hWndParent );
//#endif // (defined _UNICODE)
//                                                          ::SendMessage( hWndParent, WM_NOTIFY, WPARAM(nOwnID), LPARAM(&_data) );
//#if (defined _UNICODE)
//                                                          ::LockWindowUpdate( NULL );
//#endif // (defined _UNICODE)
                                                            _data2.hdr.code = HDN_ITEMCHANGED;
                                                            ::SendMessage( hWndParent, WM_NOTIFY, WPARAM(nOwnID), LPARAM(&_data2) );
                                                            if( ::IsWindow( hWndParent ) && ::IsWindowVisible( hWndParent ) )
                                                                        ::InvalidateRect( hWndParent, NULL, TRUE );
                                                } // if( hWndParent != NULL )
                                    } // if( m_bOnDividerAtRight )
                                    return;
                        }
                        else if( ! m_bOnButton )
                        {
                                    if( _DndIsAllowed( m_nPressingColNo ) )
                                    {
                                                CPoint ptOffset = _DndGetStartOffset();
                                                CPoint ptClientPressing;
                                                ptClientPressing = m_ptScreenPressing;
                                                ScreenToClient( &ptClientPressing );
                                                CPoint ptDiff = ptClientPressing - point;
                                                if( abs(ptDiff.x) >= ptOffset.x || abs(ptDiff.y) >= ptOffset.y )
                                                {
                                                            _DndDo( m_nPressingColNo, m_ptScreenPressing );
                                                            return;
                                                }
                                    }
                        }
            }
bool bOnButton = false, bOnDividerAtRight = false;
INT nColNo = -1;
            if( CExtPopupMenuWnd::TestHoverEnabledFromActiveHWND( m_hWnd ) )
            {
                        CPoint ptScreen;
                        ptScreen = point;
                        ClientToScreen( &ptScreen );
                        if( ::WindowFromPoint( ptScreen ) == m_hWnd )
                                    nColNo = HitTestHeaderItem( point, &bOnButton, &bOnDividerAtRight );
            }
bool bHoverChanged = false;
            if(                     m_nHoverColNo != nColNo
                        ||           m_bOnButton != bOnButton
                        ||           ( m_bOnDividerAtRight != bOnDividerAtRight && ( ! CExtPopupMenuWnd::IsKeyPressed( VK_LBUTTON ) ) )
                        )
            {
                        bHoverChanged = true;
                        m_nHoverColNo = nColNo;
                        m_nHoverIndex = ColNo2VisualIndex( m_nHoverColNo );
                        m_bOnButton = bOnButton;
                        m_bOnDividerAtRight = bOnDividerAtRight;
                        if( m_bOnDividerAtRight )
                        {
                                    HWND hWndParent = ::GetParent( m_hWnd );
                                    if( hWndParent != NULL )
                                    {
                                                UINT nOwnID = UINT( GetDlgCtrlID() );
                                                HD_NOTIFY _data;
                                                ::memset( &_data, 0, sizeof(HD_NOTIFY) );
                                                _data.hdr.hwndFrom = m_hWnd;
                                                _data.hdr.idFrom = nOwnID;
                                                _data.iButton = 0;
                                                _data.iItem = nColNo;
                                                _data.hdr.code = HDN_BEGINTRACK;
HDITEM hdItemBuffer; // to avoid common controls crashing
::memset( &hdItemBuffer, 0, sizeof(HDITEM) );
_data.pitem = &hdItemBuffer;
                                                ::SendMessage( hWndParent, WM_NOTIFY, WPARAM(nOwnID), LPARAM(&_data) );
                                    } // if( hWndParent != NULL )
                        } // if( m_bOnDividerAtRight )
            }
            if( bHoverChanged )
            {
                        if( m_nPressingColNo < 0 )
                        {
                                    HWND hWndCapture = ::GetCapture();
                                    if( m_nHoverColNo >= 0 )
                                    {
                                                if( m_hWnd != hWndCapture )
                                                            SetCapture();
                                                if(                     m_nAdvancedTipStyle != INT(CExtPopupMenuTipWnd::__ETS_NONE)
                                                            &&        (! CExtPopupMenuWnd::IsMenuTracking() )
                                                            )
                                                {
                                                            CExtPopupMenuTipWnd * pATTW = OnAdvancedPopupMenuTipWndGet();
                                                            if( pATTW != NULL )
                                                            {
                                                                        const CExtHeaderCtrl::EXTENDED_ITEM_DATA & _eii = ExtendedItemDataGet( m_nHoverColNo );
                                                                        CRect rcArea;
                                                                        if( GetItemRect( m_nHoverColNo, rcArea ) )
                                                                        {
                                                                                    CRect _rcItem, _rcIcon, _rcText, _rcSortArrow, _rcButton, _rcButtonIcon;
                                                                                    bool bSorted = false,  bSortedAscending = false;
                                                                                    OnCalcHeaderItemLayout(
                                                                                                m_nHoverColNo,
                                                                                                rcArea,
                                                                                                _rcItem,
                                                                                                _rcIcon,
                                                                                                _rcText,
                                                                                                _rcSortArrow,
                                                                                                _rcButton,
                                                                                                _rcButtonIcon,
                                                                                                &bSorted,
                                                                                                &bSortedAscending
                                                                                                );
                                                                                    if( m_bOnButton )
                                                                                    {
                                                                                                rcArea.left = _rcButton.left;
                                                                                                rcArea.right = _rcButton.right;
                                                                                    }
                                                                                    else
                                                                                    {
                                                                                                rcArea.left = _rcItem.left;
                                                                                                rcArea.right = _rcItem.right;
                                                                                    }
                                                                                    ClientToScreen( &rcArea );
                                                                                    OnAdvancedPopupMenuTipWndDisplay(
                                                                                                *pATTW,
                                                                                                rcArea,
                                                                                                m_bOnButton ? LPCTSTR(_eii.m_strTipTextButton) : LPCTSTR(_eii.m_strTipTextItem)
                                                                                                );
                                                                        }
                                                            } // if( pATTW != NULL )
                                                }
                                    }
                                    else
                                    {
                                                if( m_hWnd == hWndCapture )
                                                            ReleaseCapture();
                                    }
                        } // if( m_nPressingColNo < 0 )
                        Invalidate();
                        _DoSetCursor();
            } // if( bHoverChanged )
}