We have a class derived from CExtScrollBar, this class is used to subclassed an existing scroll bar window. There is a problem when the up/down arrow key is clicked : WM_VSCROLL ( wParam = SB_LINEDOWN ) message is sent more than once. The number is random, in the test, it ranges from 15 - 30 times.
in the following function
void CExtScrollBar::ScrollBar_TrackMouseLButtonDown( )
you will see the code snipplet
case (CExtPaintManager::__ESBMHT_BUTTON_DOWN):
// bSendScrollingNotification = false;
if( m_bSendActionNotifications )
::SendMessage(
hWndParent,
_psbd.m_bHorzBar ? WM_HSCROLL : WM_VSCROLL,
MAKEWPARAM(
( _psbd.m_bHorzBar ? SB_LINERIGHT : SB_LINEDOWN ),
0
),
LPARAM(m_hWnd)
);
...
if you put a break point here, then WM_SCROLL message is generated only once. But if you put a TRACE here, you will see the message is generated many times ?
looks like the loop is intended to simulate auto repeat behavior, but it cause a side effect here, is there any attribute or property that can avoid this behavior ?
Thanks