So when SetSuspendState is called with request for a 'forced' sleep mode, the PBT_APMSUSPEND notification is never broadcast. Only if I set forced parameter to FALSE I receive it.
Any idea why?
PS. PBT_APMRESUMEAUTOMATIC is received in either case.
PS2. PBT_APMSUSPEND is always received when run on Windows Vista/7.
Re: Is PBT_APMSUSPEND notification supposed to be sent out during forced sleep in XP?
Guys, I made a short test project to illustrate the problem. (It's attached here as a MSVS 2008 solution.)
Also a couple of screenshots:
1. Invoking it as a non-forced sleep:
2. While keeping the first process alive, I start another one and perform forced sleep from it:
and this is where the logic breaks. As you can see, I not only miss my own notification of the system entering the sleep, but also other processes won't get it either.
So my original question, is it done by design? And if so, how can my process (local service) get notified of a system entering a sleep mode on a Windows XP system?
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.