WM_NCDESTROY: Deinitialization

Started by
1 comment, last by Wavarian 19 years, 2 months ago
Just a quick question, when processing this message (before handing it over to DefWindowProc()), can I safely assume that all child windows still "exist" (but are not visible)? I'm talking about buttons, textboxes and the like. Cheers guys
Advertisement
No, by WM_NCDESTROY all child windows are gone, whether
or not you call DestroyWindow(child). Right after WM_DESTROY,
even if you do not call DefWindowProc, Windows destroys all
child windows (unless you destroyed them yourself). Try some
test code in your message proc and see for yourself that no
matter what you do, the destruction order is:

Parent WM_DESTROY
Child WM_DESTROY
Child WM_NCDESTROY (child is officially gone)
Parent WM_NCDESTROY (parent is officially gone)
Thanks

This topic is closed to new replies.

Advertisement