ShutdownBlockReasonDestroy function (winuser.h)

Indicates that the system can be shut down and frees the reason string.

Syntax

BOOL ShutdownBlockReasonDestroy(
  [in] HWND hWnd
);

Parameters

[in] hWnd

A handle to the main window of the application.

Return value

If the call succeeds, the return value is nonzero.

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

Remarks

This function can only be called from the thread that created the window specified by the hWnd parameter. Otherwise, the function fails and the last error code is ERROR_ACCESS_DENIED.

If system shutdown has been previously blocked by the ShutdownBlockReasonCreate function, this function frees the reason string. Otherwise, this function is a no-op.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll
API set ext-ms-win-ntuser-misc-l1-1-0 (introduced in Windows 8)

See also

ShutdownBlockReasonCreate

Shutting Down