Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
GetSystemPowerStatus
Collapse the table of content
Expand the table of content

GetSystemPowerStatus function

Retrieves the power status of the system. The status indicates whether the system is running on AC or DC power, whether the battery is currently charging, how much battery life remains, and if battery saver is on or off.

Syntax


BOOL WINAPI GetSystemPowerStatus(
  _Out_ LPSYSTEM_POWER_STATUS lpSystemPowerStatus
);

Parameters

lpSystemPowerStatus [out]

A pointer to a SYSTEM_POWER_STATUS structure that receives status information.

Return value

If the function succeeds, the return value is nonzero.

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

Remarks

To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0400 or later. For more information, see Using the Windows Headers.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Winbase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

System Power Status
Power Management Functions
SYSTEM_POWER_STATUS

 

 

Community Additions

ADD
Show:
© 2015 Microsoft