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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -