WM_DESTROY

2.x

WM_DESTROY

The WM_DESTROY message is sent when a window is being destroyed. It is sent to the window procedure of the window being destroyed after the window is removed from the screen.

This message is sent first to the window being destroyed and then to the child windows as they are destroyed. During the processing of the WM_DESTROY message, it can be assumed that all child windows still exist.

Parameters

This message has no parameters.

Return Value

An application should return zero if it processes this message.

Comments

If the window being destroyed is part of the clipboard-viewer chain (set by calling the SetClipboardViewer function), the window must remove itself from the clipboard-viewer chain by calling the ChangeClipboardChain function before returning from the WM_DESTROY message.

Example

This example processes the WM_DESTROY message by calling the PostQuitMessage function:

case WM_DESTROY:
    PostQuitMessage(0);
    return 0L;

See Also

ChangeClipboardChain, DestroyWindow, PostQuitMessage, SetClipboardViewer, WM_CLOSE