title: How to get Click Event of Treeview(CTreeCtrl) in MFC created at runtime?
body: <p>I have created a treeview at runtime in MFC application , I have added few nodes to it now i want to do some stuff on click of nodes so how i can get click event of treeview ?</p>
  
  <p>My code looks like this :</p>
  
  <pre><code>CTreeCtrl *m_ctlTreeview;
  m_ctlTreeview = new CTreeCtrl ;
  m_ctlTreeview-&gt;Create(WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP |
                   TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT |
           TVS_SINGLEEXPAND | TVS_SHOWSELALWAYS |  
           TVS_TRACKSELECT,
                   CRect(25, 60, 385, 260), this, 0x1221);
  
  
  hparentitem = m_ctlTreeview-&gt;InsertItem("Parent",TVI_ROOT);
  m_ctlTreeview-&gt;InsertItem("Child", hparentitem);
  </code></pre>