listctrl selection change

I want to notify the parent window of my listctrl when the selection on it is changed, and return which row is selected. Thanks :wave:
[134 byte] By [floatingkent] at [2007-11-18 22:15:09]
# 1 Re: listctrl selection change
I want to notify the parent window of my listctrl when the selection on it is changed, and return which row is selected. ThanksAnd what exactly is your problem?
gstercken at 2007-11-11 1:04:32 >
# 2 Re: listctrl selection change
catch this notification LVN_ODSTATECHANGED it indicates that the stat of an item has changed
Black_Daimond at 2007-11-11 1:05:29 >
# 3 Re: listctrl selection change
Just use an event of OnClick... (OnSelChange too)

1) Then check if one item is selected

2) Check if it differs from the previous

3) Send the value to your main window with PostMessage...

Note: you must have the handle of the main window and you can put the value in the parameters of the message!

I hope this helps you a bit futher!
Tischnoetentoet at 2007-11-11 1:06:28 >
# 4 Re: listctrl selection change
:confused:
I am just a newb in windows programming. I am not quite sure on where to put those PostMessage function, and I never used it before, can you just offer a piece of code for demo? Thanks a lot. :thumb:
floatingkent at 2007-11-11 1:07:28 >