EndTask function

[This function is not intended for general use. It may be altered or unavailable in subsequent versions of Windows.]

Forcibly closes the specified window.

Syntax

BOOL EndTask(
  HWND hWnd,
  BOOL fShutDown,
  BOOL fForce
);

Parameters

hWnd

Type: HWND

A handle to the window to be closed.

fShutDown

Type: BOOL

Ignored. Must be FALSE.

fForce

Type: BOOL

A TRUE for this parameter will force the destruction of the window if an initial attempt fails to gently close the window using WM_CLOSE. With a FALSE for this parameter, only the close with WM_CLOSEis attempted.

Return Value

Type: Type: BOOL

If the function succeeds, the return value is nonzero.

If the function fails, the return value is FALSE. To get extended error information, call GetLastError.

Remarks

This function was not included in the SDK headers and libraries until Windows XP with Service Pack 1 (SP1) and Windows Server 2003. If you do not have a header file and import library for this function, you can call the function using LoadLibrary and GetProcAddress.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll

See Also

CloseWindow

Conceptual

DestroyWindow

Reference

WM_CLOSE

Windows