Andre Michaud has a nice story on dealing with the XP and Vista power APIs in this month's MSDN Magazine.  He shows how to "create an approach to power-awareness that is consistent and accounts for the differences regarding power notification on both Windows XP and Vista." Andre shows how to interop with the unmanaged APIs by using a managed wrapper class, and then he derives a PowerAwareWindow class with power-related dependency properties and events. A very nice piece of work, Andre!

Andre Michaud's power-aware WPF app