title: Can't catch TVN_SELCHANGED
body: <p>I have a CTreeCtrl in a dialog and catch TVN_SELCHANGED messages, but execution doesn't go into handlers. What can be wrong?
  My code:</p>
  
  <pre><code>BEGIN_MESSAGE_MAP(CMaterParamExtDlg, CDialog)
     ON_NOTIFY(TVN_ITEMCHANGING, IDC_MATERIAL_PROP_TREE, OnSelChangingTreeCtrl)
     ON_NOTIFY(TVN_ITEMCHANGED, IDC_MATERIAL_PROP_TREE, OnSelChangedTreeCtrl)
  END_MESSAGE_MAP()
  
  void CMaterParamExtDlg :: OnSelChangedTreeCtrl (NMHDR* pNMHDR, LRESULT* pResult) 
  {
      if (m_TreeCtrl != 0)
      {
          HTREEITEM treeitem = m_TreeCtrl-&gt;GetSelectedItem();
          CString treeitemtext = m_TreeCtrl-&gt;GetItemText(treeitem);
  
          MessageBox(treeitemtext);
      }
  
      *pResult = 0;
  }
  
  void CMaterParamExtDlg :: OnSelChangingTreeCtrl (NMHDR* pNMHDR, LRESULT* pResult)
  {
      if (m_TreeCtrl != 0)
      {
          HTREEITEM treeitem = m_TreeCtrl-&gt;GetSelectedItem();
          CString treeitemtext = m_TreeCtrl-&gt;GetItemText(treeitem);
  
          MessageBox(treeitemtext);
      }
  
      *pResult = 0;
  }
  </code></pre>
  
  <p>I tried to use breakpoints to see if execution goes into handlers but nothing happens.</p>
  
  <p>Tree Control properties:</p>
  
  <pre><code>CONTROL         "",IDC_MATERIAL_PROP_TREE,"SysTreeView32",TVS_HASBUTTONS 
  | TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP 
  | TVS_TRACKSELECT | WS_BORDER | WS_HSCROLL | WS_TABSTOP,4,4,115,218
  </code></pre>