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.
Call this method to destroy a modeless dialog box.
DestroyWindow 关闭非模态对话框。 退出消息循环，真正结束进程。有不少程序窗口关闭，但是不等于退出运行。