hi boys!
I have a stupid problem with a tree view control: when the user changes the selection of a tree view item i want to get the text of the newly selected item. I have done the following job:
i trap WM_NOTIFY, then i check for
((NM_TREEVIEW*)lParam)->hdr.code == TVN_SELCHANGED
if so i take
((NM_TREEVIEW*)lParam)->itemNew.pszText
and display it in a messagebox. Well, every time i change item the messagebox pops up (so the trapping is corret i guess!), but the text is not displayed :-( I checked all other fields of the structures TREEVIEW and ITEM and the seems to be coherent. In particular in
((NM_TREEVIEW*)lParam)->itemNew.mask
i get "1C" value, so the LVIF_TEXT (value "1") is not included. Maybe this the problem?? If so how do i set that flag? I tried with TVN_SETDISPINFO but it dowsnt works.
Have i to use another way to ghet the text when changing selection??
Thank you!!!!
AndreaGeddon
Posted on 2002-01-18 05:39:09 by AndreaGeddon
Hi AndreaGeddon

This RadASM project will show how to do it.

KetilO
Posted on 2002-01-18 10:12:11 by KetilO
thanx a lot for src! I simply had to call TVM_GETITEM in the WM_NOTIFY. Btw, if I try to use TVM_GETITEM outside the wm_notify the message fails, someone told me its normal :-( Is it correct?
Thank you very much
AndreaGeddon
Posted on 2002-01-19 14:06:04 by AndreaGeddon
Hi AndreaGeddon

No it is not true.

KetilO
Posted on 2002-01-19 14:57:35 by KetilO