Archived

This topic is now archived and is closed to further replies.

CTreeCtrl - help!!!!!!

This topic is 6285 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello ladies and gentlemens and welcom to micro$oft hell! The question of the day is - how to find out if any spesific item in CTreeCtrl was clicked?... MSDN has "common controls" example, it suxx azz and i don''t really know what to do now... anyways. my code: CTreeCtrl m_tree; HTREEITEM Resourses=m_tree.InsertItem("Resourses"); HTREEITEM Snd=m_tree.InsertItem("Sounds",Resourses); HTREEITEM Anim=m_tree.InsertItem("Animations",Resourses); m_tree.InsertItem("Lead In",Snd); m_tree.InsertItem("Responce",Snd); m_tree.InsertItem("Anim List",Anim); ok, so how to find out that i clicked for example "Responce" node?... Please ppl, help, i''m completely lost.

Share this post


Link to post
Share on other sites
2 ways:

To determine the currently selected item not at time of click:

CTreeCtrl''s GetSelectedItem()

Add TVN_SELCHANGED using class wizard (this is one of the WM_NOTIFY command set members).

You can process NM_CLICK and/or NM_DBLCLK, however, I believe these messages fire during expansion of your tree as well as during selection, therefore your results will be varied as to what the user actually did (whether or not they really selected something)

-fel

Share this post


Link to post
Share on other sites