没有找到EndDialog( _In_ HWND hDlg,_In_ INT_PTR nResult)的实现代码,好像被封装起来了,下面是别人解释的!
Calling EndDialog on modeless dialogs
For clarity, EndDialog should not be called on a dialog created via CreateDialog, because while the call will appear to have succeeded, it really only hides the window (the window handle still exists). Instead, explicitly call DestroyWindow.
MSDN上不是讲的很清楚吗?
When you implement a modeless dialog box, always override the OnCancel member function and call DestroyWindow from within it. Don't call the base class CDialog::OnCancel, because it calls EndDialog, which will make the dialog box invisible but will not destroy it. You should also override PostNcDestroy for modeless dialog boxes in order to delete this, since modeless dialog boxes are usually allocated with new. Modal dialog boxes are usually constructed on the frame and do not need PostNcDestroy cleanup.