C ++ Power Management API: http://msdn.microsoft.com/en-us/library/aa373170.aspx
The .NET Power Management APIs are located in the Microsoft.Win32 namespace.
Example from http://msdn.microsoft.com/en-us/library/hxkc1kwd.aspx :
private void powerModeChanged(System.Object sender, Microsoft.Win32.PowerModeChangedEventArgs e) { int si = SystemInformation.PowerStatus; switch (si) { case BatteryChargeStatus.Low: MessageBox.Show("Battery is running low", MessageBoxIcon.Exclamation); case BatteryChargeStatus.Low: MessageBox.Show("Battery is critically low", MessageBoxIcon.Stop); Default:
You can find a lot more in this namespace.
Dinah
source share