void CWelcomeDlg::OnClose() { // TODO: Add your message handler code here and/or call default if(MessageBox("Are you sure close this windows?", "closing", MB_OKCANCEL|MB_ICONQUESTION) == IDOK) { CDialog::OnClose(); } //创建一个基于对话框的应用程序. //通过类向导选择WM_CLOSE消息事件 //在对话框的消息事件中实现代码 }
转载于:https://www.cnblogs.com/pythonschool/archive/2012/11/15/2770053.html