GetCurrentBatteryState Method

Vista Bridge Library

[This is preliminary documentation and is subject to change.]

Gets a snapshot of the current battery state.

Namespace:  Microsoft.SDK.Samples.VistaBridge.Library.PowerManagement
Assembly:  VistaBridgeLibrary (in VistaBridgeLibrary.dll) Version: 1.4.0.0 (1.4.0.0)

Syntax

C#
public static BatteryState GetCurrentBatteryState()
Visual Basic (Declaration)
Public Shared Function GetCurrentBatteryState As BatteryState
Visual C++
public:
static BatteryState^ GetCurrentBatteryState()

Return Value

A BatteryState instance that represents the state of the battery at the time this method was called.

Exceptions

ExceptionCondition
System..::.InvalidOperationExceptionThe system does not have a battery.
System..::.PlatformNotSupportedExceptionRequires XP/Windows Server 2003 or higher.

See Also