Link to home
Start Free TrialLog in
Avatar of ymao
ymao

asked on

ListView item active notification

Hi

I am writing a Win32 ListView control. I like to be infmormed whenever a listView item is activated (LVNI_SELECTED|LVNI_FOCUSED). This can be either keyboard scroll, or mouse click, or even programatically select on ListView item. Strangly enough, I can not intercept the LVN_ITEMACTIVATE message at all. See, I don't want to be driving by the keyboard or the mouse message, but rather let ListView itself tell me what is being activated.

Any clue? Thanks
Avatar of byang
byang
Flag of United States of America image

Can you show your code here ?
Avatar of mikezang
mikezang

You need to subclass ClistView for process WM_NOTIFY message inside a control.
Mike
1. Handle the LVN_ITEMCHANGING or LVN_ITEMCHANGED notification message

2. Use GetNextItem to get the current selection in response to this notification.

3. If you store the previous selection in a variable, you will be able to compare this against #2
ASKER CERTIFIED SOLUTION
Avatar of Answers2000
Answers2000

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ymao

ASKER

Answer2000's solution works perfect!!!!