[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
| 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
| Exception | Condition |
|---|
| System..::.InvalidOperationException | The system does not have a battery. |
| System..::.PlatformNotSupportedException | Requires XP/Windows Server 2003 or higher. |
See Also