Listview state change 
Author Message
 Listview state change

I'm trying to do stuff when the selected line changes in the listview.
I have no problem caputuring single (and double) clicks, but I want to
deal with the case when the user uses the keyboard to switch to another
line.  Anyway, I seem to have trouble capturing LVN_ODSTATECHANGED
which is what I think I have to do.  I try using ON_NOTIFY_REFLECT and
ON_NOTIFY but my routine never gets called.

Any tips?

Laurence Roberts



Mon, 31 Jul 2000 03:00:00 GMT  
 Listview state change

I've done some more research, and come up with the following strange result:
If I have this:
        ON_NOTIFY(LVN_COLUMNCLICK, 3002, StateChangeHandler)
Then my handler routine is called when I click on a column header.

But if I have this:
        ON_NOTIFY(LVN_ODSTATECHANGED, 3002, StateChangeHandler)
Then nothing I do (clicking on stuff, arrowing up and down) will call
my handler routine.  I would expect from the documentation at
http://www.microsoft.com/msdn/sdk/inetsdk/help/itt/CommCtls/ListView/...
that changing the status by moving around would cause this message to
be sent.

Anyone used LVN_ODSTATECHANGED or have any suggestions?

Laurence Roberts



Tue, 01 Aug 2000 03:00:00 GMT  
 Listview state change

Quote:
>But if I have this:
>    ON_NOTIFY(LVN_ODSTATECHANGED, 3002, StateChangeHandler)
>Then nothing I do (clicking on stuff, arrowing up and down) will call
>my handler routine.

Laurence,

Is your control owner drawn or a virtual list view? The documentation
I'm reading is a bit vague here, but I suspect this notification only
works for some specific list view style. I see a reference that says
this message is only applicable to Windows CE. You certainly need
version 4.70 (or greater) of comctl32.dll

Have you tried using LVN_ITEMCHANGED instead?

Dave
----
Address is altered to discourage junk mail.
Remove ".---" for the real address.
http://www.bj.co.uk



Tue, 01 Aug 2000 03:00:00 GMT  
 Listview state change

Yes, LVN_ITEMCHANGED works.  I think there might be an omission in the
documentation, since all the other LVN_ODxx messages are for virutal
listviews.  I have a very recent version of comctl32, so I
don't think that is the problem.

Thanks,
Laurence



Tue, 01 Aug 2000 03:00:00 GMT  
 Listview state change

Quote:
>I think there might be an omission in the
>documentation, since all the other LVN_ODxx messages are for virutal
>listviews.

I agree with you there Laurence. I think that must the situation.

You should report this to MS via the web site (I can't remember the
URL, but there should be one) and suggest that the documentation is
updated in future releases so that it clarifies the point.

Dave
----
Address is altered to discourage junk mail.
Remove ".---" for the real address.



Thu, 03 Aug 2000 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Bitmaps (state images) in a ListView Control not Getting Displayed in win 2000

2. Listview item state questions??

3. Changing a window state

4. How to change the object state in Richtextbox

5. Changing the Caps Lock State?

6. Toolbar Buttons not changing state

7. How to change the object state in Richtextbox

8. changing control's state from outside dialog

9. Can't change cursor state

10. How do I tell when a checkbox changes state

11. problems capturing state change event from a List Control: OnOdstatechangedFunction

12. Changing control state

 

 
Powered by phpBB® Forum Software