Detect system standby/sleep/hibernate from .NET Windows Service ?
In a Windows Service, I need to detect when the computer goes into sleep and when it wakes up, and run some code on these events. This needs to be done for sleep, standby and hibernate power modes. How do I do that ? ...