PowerCreateRequest function

Creates a new power request object.

Syntax

HANDLE PowerCreateRequest(
  PREASON_CONTEXT Context
);

Parameters

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

   
Windows version Windows 7 [desktop apps only] 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