How can I determine why the machine turned off?

I would like to be able to determine, programmatically, why Vista came out of standby (S3). Any language is fine, although .NET would be better. I am looking to include this code in the application I'm working on.

I’m looking for reasons such as “The Media Center wanted to record a program,” “User input woke up the car,” “Windows planning is scheduled to run,” things like that. I searched on Google, Bing, and MSDN, but I could only find what related to Windows Mobile.

Can someone point me to a function or object that can provide this information?

+5
source share
1 answer

The top-level window receives the WM_POWERBROADCAST message when it wakes up, but you can only tell if it was automatic (Media Center, updating Windows, etc.) or the user (pressing the power button, etc.)

+1
source

All Articles