quote:
Originally posted by SonicSam
quote:
Originally posted by CookieRevised
Never check it before myself, but maybe there are some Windows events you can check for this? eventvwr.msc
Checked that earlier, the only relevant event is Power-Troubleshooter which shows what wakes the machine out of sleep. Even that doesn't really help.
Hmm... you sure? Because there are special event messages for this according to MSDN. Maybe they are not enabled to show up in the Event Log by default though. So, if you can't find the correct settings to enable them or something like that, maybe you can make your own event logger catching the
WM_POWERBROADCAST broadcasted Windows message with the
PBT_APMPOWERSTATUSCHANGE event id. And when the app recieves this message, you can check the power state with the
GetSystemPowerStatus API.