title: How to notify a parent CDialog that a child CWnd has been updated so that another child control can update in response?
body: <p>I have created a custom control as a derived class of <code>CWnd</code> that selects a sub-range from a range.  To test, I created a MFC Dialog Application in Visual Studio 2010 with a member instance of my custom class and some member <code>CEdit</code> instances to display the currently selected range from the custom control.</p>
  
  <p>In the custom class, I have:</p>
  
  <pre><code>BEGIN_MESSAGE_MAP(CRangeSelectorCtrl, CWnd)
    ...
    ON_WM_LBUTTONDOWN()
    ...
  END_MESSAGE_MAP()
  
  ...
  
  void CRangeSelectorCtrl::OnLButtonDown(UINT nFlags, CPoint point)
  {
    if (leftScrollArrowRect().PtInRect(point))
    {
      d_range_selector.SlideBar(-1);
      Invalidate();
    }
    else if (rightScrollArrowRect().PtInRect(point))
    {
      d_range_selector.SlideBar(1);
      Invalidate();
    }
    CWnd::OnLButtonDown(nFlags, point);
  }
  </code></pre>
  
  <p>In my test dialog app, I have:</p>
  
  <pre><code>BEGIN_MESSAGE_MAP(CTestRangeSelectorCtrlDlg, CDialogEx)
    ...
    ON_WM_PARENTNOTIFY()
    ...
  END_MESSAGE_MAP()
  ...
  BOOL CTestRangeSelectorCtrlDlg::OnInitDialog()
  {
    CDialogEx::OnInitDialog();
    ...
    m_range_selector_ctrl.ModifyStyleEx(WS_EX_NOPARENTNOTIFY, 0);
     ...
  }
  ...
  void CTestRangeSelectorCtrlDlg::OnParentNotify(UINT message, LPARAM lParam)
  {
    CDialogEx::OnParentNotify(message, lParam);
    if (message == WM_LBUTTONDOWN)
    {
      updateEditBoxes();
    } 
  }
  </code></pre>
  
  <p>This almost works, but the problem is that the dialog's <code>OnParentNotify</code> get's called before the child has updated in response to the left-click so the values are all behind by one click.</p>
  
  <p>How can I make <code>OnParentNotify</code> or another method in the parent be called after <code>OnLButtonDown</code> finishes in the child?  Or is there another way to accomplish what I want?</p>
  
  <p>I have tried having the parent respond to <code>WM_LBUTTONUP</code> messages but when I add message handlers for <code>WM_LBUTTONUP</code> in the child and check for them in <code>OnParentNotify()</code> they are called in the child but never propagate to the parent (this is true even when I comment out the <code>CWnd::OnLButtonDown</code> call in <code>CWnd::OnLButtonDown(nFlags, point)</code>.</p>