Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize


The framework calls this member function to inform the CWnd object that it is being destroyed.

afx_msg void OnDestroy( );


OnDestroy is called after the CWnd object is removed from the screen.

OnDestroy is called first for the CWnd being destroyed, then for the child windows of CWnd as they are destroyed. It can be assumed that all child windows still exist while OnDestroy runs.

If the CWnd object being destroyed is part of the Clipboard-viewer chain (set by calling the SetClipboardViewer member function), the CWnd must remove itself from the Clipboard-viewer chain by calling the ChangeClipboardChain member function before returning from the OnDestroy function.

See Also

CWnd Overview | Class Members | Hierarchy Chart | CWnd::ChangeClipboardChain | CWnd::DestroyWindow | CWnd::SetClipboardViewer

© 2015 Microsoft