title: Close a dialog on clicking CANCEL button ignoring EN_KILLFOCUS
body: <p>I have a CEdit field in my dialog where I have implemented <code>EN_KILLFOCUS</code>, so when the user enters invalid data a warning message is displayed when the focus moves away from this field and the focus returns to the CEdit field so that the user can enter proper data. If the user enters invalid data and clicks on the CANCEL button, then also a warning message is displayed which is undesirable because the user is anyway trying to cancel his actions. I have tried implementing PostQuitMessage when the user clicks on CANCEL button, but this closes the entire application. I want only my dialog to close when the user clicks CANCEL button. Is there any way that I can close the dialog instantly after I click on CANCEL button. This is the code that I tried.</p>
  
  <pre><code>void CMARPropWnd::OnParentNotify(UINT message, LPARAM lParam)   
  {
      CCDialog::OnParentNotify(message, lParam); 
      // TODO: Add your message handler code here 
      CPoint ptButtonDown(LOWORD(lParam),HIWORD(lParam)); 
      if ((message == WM_LBUTTONDOWN)  &amp;&amp; (ChildWindowFromPoint(ptButtonDown) == GetDlgItem(eMARPropWndCancelBtnId))) 
      { 
          PostQuitMessage(0);
      } 
  }
  </code></pre>