MFC: WM_MOUSEWHEEL question
Posted on 2011-02-17
In my application, I am synchronizing two listboxes. Here is my code:
LRESULT CLineListBox::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
if(message == WM_VSCROLL || message == WM_HSCROLL || message == WM_MOUSEHWHEEL)
static bool bScrollHandled = false; // This is needed to avoid sending messages infinitely
m_pSiblingListBox->PostMessage(message, wParam, lParam);
bScrollHandled = true;
bScrollHandled = false;
return CListBox::WindowProc(message, wParam, lParam);
I am surprised to see that though synchronization works for both vertical and horizontal scroll, the mousewheel doesn't work. In fact, WM_MOUSEHWHEEL is not even caught.
Could you please help me?