How to detect when the laptop is running on batteries (or AC) in .NET?
How to detect when laptop power cable has been disconnected?