PowerCreateRequest function (winbase.h)

Creates a new power request object.

Syntax

HANDLE PowerCreateRequest(
  [in] PREASON_CONTEXT Context
);

Parameters

[in] Context

Points to a REASON_CONTEXT structure that contains information about the power request.

Return value

If the function succeeds, the return value is a handle to the power request object.

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

Remarks

When the power request object is no longer needed, use the CloseHandle function to free the handle and clean up the object.

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

PowerClearRequest

PowerSetRequest