WM_CLOSE message

Expand
4 out of 8 rated this helpful - Rate this topic

WM_CLOSE message

Applies to: desktop apps only

Sent as a signal that a window or an application should terminate.

A window receives this message through its WindowProc function.

#define WM_CLOSE                        0x0010

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

An application can prompt the user for confirmation, prior to destroying a window, by processing the WM_CLOSE message and calling the DestroyWindow function only if the user confirms the choice.

By default, the DefWindowProc function calls the DestroyWindow function to destroy the window.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winuser.h (include Windows.h)

See also

Reference
DefWindowProc
DestroyWindow
Conceptual
Windows

 

 

Send comments about this topic to Microsoft

Build date: 5/5/2012

Did you find this helpful?
(1500 characters remaining)
Community Additions ADD
Value

VB:

WM_CLOSE = &H10

C#

WM_CLOSE = 0x0010