#### 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.

## 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 on other sites
  //Maybe?whenclickedon();

http://msdn.microsoft.com/library/default.asp

wtf, it changes
O n C l i c k ( ) to whenclickedon(), this some kind of joke gamedev!?

Edited by - Magmai Kai Holmlor on October 2, 2000 12:01:38 AM

##### 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