共用方式為


WM_DESTROY

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

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

Syntax

WM_DESTROY wParam = 0; 
    lParam = 0; 

Return Value

An application should return zero if it processes this message.

Remarks

In Windows Embedded CE, DefWindowProc does not automatically call PostQuitMessage in its handling of WM_DESTROY.

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

Header winuser.h
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

Windows Messages
DestroyWindow
PostQuitMessage
WM_CLOSE