c++ - Windows API: could WM_DESTROY be sent without WM_CLOSE beforehand? -
the default way of handling lifetime of windows in windows listening wm_close message, deciding whether close window or not , optionally processing wm_destroy message (for cleanup etc.) afterwards.
is there scenario wm_destroy sent without wm_close beforehand? mean "by system", not manually calling destroywindow()
or postmessage()
. or safe rely on wm_close being sent before wm_destroy?
yes. if create mfc dialog based application , press "cancel" button (idcancel id), doesn't send wm_close event. if press "esc" key, same thing.
if click "x" button on upper-right corner of dialog box, yes wm_close sent, though.
Comments
Post a Comment