Robin Dunn a écrit :
Adam Groszer wrote:
Sorry, seems like my fault, forgot to write that it is the
ListCtrl_virtual demo that's missing the events, the ListCtrl demo
works fine for me also.Yes, that explains it. The virtual list control will not do anything that could potentially cause it to do some O(N) operation since it can potentially have a *very* large N. For example, think about how long it would take to do selection events for a Ctrl-A in a listctrl with a billion items in it. (Not only sending the selection events, but also accessing each item in order to fill the event object...)
OTOH, I would have expected it to still send an event for Shift-Up or Shift-Down since that is an O(1) operation. You may want to enter a bug report about this (category == "Common") and see if it gets any positive traction.
Funny that we solved this problem just today.
The explanation is there:
For virtual lists, shift-up and shift-click do not generate LVN_ITEMCHANGED notifications, but a single LVN_ODSTATECHANGED notification, indicating the range of items that changed state.
We implemented an easy workaround, by extending the MSWOnNotify function to handle this LVN_ODSTATECHANGED. For each item in the range, we send SelectionChanged events.
Not sure it is the right thing to do, but this solved the problem for us.
Sorry I don't have the code here. I will try to post it tomorrow.
It is very similar to the LVN_ITEMCHANGED case, though.
A bientot,
···
--
Amaury Forgeot d'Arc