title: How to handle notify messages in child & parent classes?
body: <p>I have a custom CTabCtrl which I am trying to customize (to automatically change pages).</p>
  
  <p>If I handle <code>ON_NOTIFY_REFLECT(TCN_SELCHANGE, ...)</code> in my tab control, <code>ON_NOTIFY(TCN_SELCHANGE, ...)</code> is not received by the parent class.</p>
  
  <p>How can I receive both notify messages in the child and parent classes? </p>
  
  <p>Currently I am using a "workaround" of manually sending the WM_NOTIFY message to the parent class:</p>
  
  <pre><code>void CMyTabControl::OnSelChange(NMHDR *pHeader, LRESULT *pResult)
  {
      const int index = this-&gt;GetCurSel();
      this-&gt;ShowTab(index);
  
      const CWnd *const pParent = this-&gt;GetParent();
      if (pParent != NULL)
      {
          *pResult = pParent-&gt;SendMessage(WM_NOTIFY, TCN_SELCHANGE, 
              reinterpret_cast&lt;LPARAM&gt;(pHeader));
      }
  }
  </code></pre>
  
  <p><strong>Edit:</strong> I've tried both *pResult = 0 and *pResult = 1 but it still doesn't send the message onto the parent.
  Also, I've noticed that when I send the message on to the parent I end up in an almost infinite loop (for some reason it does break out after several iterations).</p>