|Date:||July 26, 2005 / year-entry #203|
|Summary:||There are two window messages closely-associated with window destruction, the WM_DESTROY message and the WM_NCDESTROY message. What's the difference? The difference is that the WM_DESTROY message is sent at the start of the window destruction sequence, whereas the WM_NCDESTROY message is sent at the end. This is an important distinction when you have child windows....|
The difference is that
hwnd = parent, uMsg = WM_DESTROY hwnd = child, uMsg = WM_DESTROY hwnd = child, uMsg = WM_NCDESTROY hwnd = parent, uMsg = WM_NCDESTROY
Notice that the parent receives the
Having two destruction messages, one sent top-down and the other
bottom-up, means that you can perform clean-up appropriate to
a particular model when handling the corresponding message.
If there is something that must be cleaned up top-down, then you can
These two destruction messages are paired with the analogous
What's this "absence of weirdness" I keep alluding to? We'll look at that next time.
[Typos corrected, 9:30am]
<-- Back to Old New Thing Archive Index