WMCLOSE
WMCLOSE is not an official Windows API term. In most contexts, it is used informally to refer to the WM_CLOSE message in the Win32 API, a window message sent when a window is requested to close. WM_CLOSE is defined as 0x0015 in Winuser.h. It is posted to a window procedure when the user clicks the close button, chooses Close from the window menu, or when a program requests the window to close. The window procedure can handle WM_CLOSE to perform tasks such as prompting the user to save data, releasing resources, or canceling the close operation. If the message is not handled, the default processing is to call DestroyWindow, which destroys the window and causes WM_DESTROY and WM_NCDESTROY to be posted subsequently.
In higher-level frameworks, the concept exists under different names. For example, in .NET Windows Forms, the
Note that WM_CLOSE is distinct from end-of-session messages such as WM_QUERYENDSESSION and WM_ENDSESSION, which relate to
See also: WM_CLOSE, WM_DESTROY, DestroyWindow, WM_QUERYENDSESSION, WM_ENDSESSION.