When I create a dialog using DialogBox, it won’t close unless I handle WM_CLOSE in my own DLGPROC function and call EndDialog.
I know that this is by design, but I’m interested why was it chosen for WM_CLOSE not to be handled automatically by DefDlgProc? Are there any good reasons for that?
Ask yourself this:
What would the default handling of WM_CLOSE be? Calling
EndDialog? I think EndDialog would only work in very rare situations.Other suggestions: