5种方式关闭 MFC 对话框程序时,几个主要方法的执行顺序。

[X / Alt+F4]
[7580] ____DebugInfo____ CDialogTestDlg::WindowProc, got WM_CLOSE
[7580] ____DebugInfo____ CDialogTestDlg::OnClose
[7580] ____DebugInfo____ CDialogTestDlg::OnCancel
[7580] ____DebugInfo____ CDialogTestDlg::DestroyWindow
[7580] ____DebugInfo____ CDialogTestDlg::WindowProc, got WM_DESTROY
[7580] ____DebugInfo____ CDialogTestApp::ExitInstance
 
 
[OK]
[5232] ____DebugInfo____ CDialogTestDlg::OnOK
[5232] ____DebugInfo____ CDialogTestDlg::DestroyWindow
[5232] ____DebugInfo____ CDialogTestDlg::WindowProc, got WM_DESTROY
[5232] ____DebugInfo____ CDialogTestApp::ExitInstance
 
 
[Cancel / ESC]
[7028] ____DebugInfo____ CDialogTestDlg::OnCancel
[7028] ____DebugInfo____ CDialogTestDlg::DestroyWindow
[7028] ____DebugInfo____ CDialogTestDlg::WindowProc, got WM_DESTROY
[7028] ____DebugInfo____ CDialogTestApp::ExitInstance

你可能感兴趣的:(Windows)