1

When trying to implement the handling of SHIFT+MouseWheel events for a CListCtrl to scroll horizontally, I was surprised, that on SHIFT+MouseWheel_UP the CListCtrl item under the mouse cursor got selected, that the selection changed.

The WM_MOUSEWHEEL message turned into a LVN_ITEMCHANGED notification.

I tried to reproduce the behavior in a smaller C++ project and yes - SHIFT+MouseWheel_UP selected the item in the CListCtrl right undr the mouse cursor.

Does anybody knows this behavior or reasons for this behavior? May eventually a style or an extended style influence this behavior?

Thanks in advance!

Martin Lemburg
  • 507
  • 2
  • 12
  • Do you have `LVS_EX_TRACKSELECT` extended stye? from https://learn.microsoft.com/en-us/windows/win32/Controls/extended-list-view-styles: Enables hot-track selection in a list-view control. Hot track selection means that an item is automatically selected when the cursor remains over the item for a certain period of time. The delay can be changed from the default system setting with a LVM_SETHOVERTIME message. This style applies to all styles of list-view control. You can check whether hot-track selection is enabled by calling SystemParametersInfo. – Vlad Feinstein Dec 16 '20 at 19:01
  • Thanks @VladFeinstein, no we don't use the ``LVS_EX_TRACKSELECT`` extended style. – Martin Lemburg Dec 16 '20 at 21:03
  • The strange thing is that this behavior is present on SHIFT+MouseWheel_UP only, not on SHIFT+MouseWheel_DOWN – Flaviu_ Dec 17 '20 at 08:58

0 Answers0