PowerClearRequest function (winbase.h)

Decrements the count of power requests of the specified type for a power request object.

Syntax

BOOL PowerClearRequest(
  [in] HANDLE             PowerRequest,
  [in] POWER_REQUEST_TYPE RequestType
);

Parameters

[in] PowerRequest

A handle to a power request object.

[in] RequestType

The power request type to be decremented. This parameter can be one of the following values.

Value Meaning
PowerRequestDisplayRequired
The display remains on even if there is no user input for an extended period of time.
PowerRequestSystemRequired
The system continues to run instead of entering sleep after a period of user inactivity.
PowerRequestAwayModeRequired
The system enters away mode instead of sleep. In away mode, the system continues to run but turns off audio and video to give the appearance of sleep.
PowerRequestExecutionRequired
The calling process continues to run instead of being suspended or terminated by process lifetime management mechanisms. When and how long the process is allowed to run depends on the operating system and power policy settings.

When a PowerRequestExecutionRequired request is active, it implies PowerRequestSystemRequired.

The PowerRequestExecutionRequired request type can be used only by applications. Services cannot use this request type.

Windows 7 and Windows Server 2008 R2:  This request type is supported starting with Windows 8 and Windows Server 2012.

Return value

If the function succeeds, it returns a nonzero value.

If the function fails, it returns zero. To get extended error information, call GetLastError.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header winbase.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See also

PowerCreateRequest

PowerSetRequest