(1) EndDialog(0);
关闭模态对话框,并且将参数作为父对话框调用的返回值。
Call this method to destroy a modal dialog box.
EndDialog must be called through the dialog box procedure. After the dialog box is destroyed, Windows uses the value of nRetCode as the return value for DoModal, which created the dialog box.
(2) DestroyWindow();
Call this method to destroy a modeless dialog box.
DestroyWindow 关闭非模态对话框。 退出消息循环,真正结束进程。有不少程序窗口关闭,但是不等于退出运行。