WM_DESTROY message

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 (if any) as they are destroyed. During the processing of the message, it can be assumed that all child windows still exist.

A window receives this message through its WindowProc function.

#define WM_DESTROY                      0x0002

Parameters

wParam

This parameter is not used.

lParam

This parameter is not used.

Return value

Type: LRESULT

If an application processes this message, it should return zero.

Remarks

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 chain by processing the ChangeClipboardChain function before returning from the WM_DESTROY message.

Requirements

Requirement Value
Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Winuser.h (include Windows.h)

See also

Reference

ChangeClipboardChain

DestroyWindow

PostQuitMessage

SetClipboardViewer

WM_CLOSE

Conceptual

Windows