DestroyWindow

This function destroys the specified window.

At a Glance

Header file: Winuser.h
Windows CE versions: 1.0 and later

Syntax

BOOL DestroyWindow( HWND hWnd );

Parameters

hWnd

Handle to the window to be destroyed.

Return Values

Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.

Remarks

The DestroyWindow function does not support the WM_NCDESTROY or the WM_PARENTNOTIFY message.

The DestroyWindow function destroys children of the specified window.

The DestroyWindow function does not flush the thread message queue.

A thread cannot use DestroyWindow to destroy a window created by a different thread.

If the window being destroyed is a child window that does not have the WS_EX_NOPARENTNOTIFY style, a WM_PARENTNOTIFY message is sent to the parent.

See Also

CreateDialog, CreateWindow, CreateWindowEx, WM_DESTROY