MFC Close Edit Control's Enter response & modify the window's default close button response event

  1. Close the Enter response of Edit Control
    Rewrite the OnOk() method of the corresponding modal box
void CLoginDlg::OnOK()
{
	// TODO: 在此添加专用代码和/或调用基类

	//CDialogEx::OnOK();
}
  1. Modify the response event of the window's default close button
    Add the corresponding window's message WM_CLOSE response function OnClose()
void CLoginDlg::OnClose()
{
	// TODO: 在此添加消息处理程序代码和/或调用默认值
	exit(0);
	//CDialogEx::OnClose();
}

Guess you like

Origin blog.csdn.net/weixin_49035356/article/details/109613400