Discussion:
Detect resume from hibernate in a windows service
(too old to reply)
Stefan Kuhr
2009-07-15 08:27:20 UTC
Permalink
Hello everyone,

I would like to detect resume from hibernation in my service.
Interactive processes receive a WM_POWERBROADCAST message with the
wParam set to PBT_APMRESUMESUSPEND in this case.

The HandlerEx documentation for services says, that the service can
receive a SERVICE_CONTROL_POWEREVENT notification in this case but it
seems to me like the Guids that are sent with this notification (a
POWERBROADCAST_SETTING structure) only describe changes in the power
settings, not the power modes, as is necessary for detection of resume
from hibernation.

Can someone confirm that a service cannot receive power mode change
notifications or otherwise tell me what event could be used for this
purpose in a service?

Any help appreciated,
--
Stefan Kuhr
Doron Holan [MSFT]
2009-07-16 23:33:54 UTC
Permalink
why is hibernate different than resume from standby?
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Stefan Kuhr
Hello everyone,
I would like to detect resume from hibernation in my service. Interactive
processes receive a WM_POWERBROADCAST message with the wParam set to
PBT_APMRESUMESUSPEND in this case.
The HandlerEx documentation for services says, that the service can
receive a SERVICE_CONTROL_POWEREVENT notification in this case but it
seems to me like the Guids that are sent with this notification (a
POWERBROADCAST_SETTING structure) only describe changes in the power
settings, not the power modes, as is necessary for detection of resume
from hibernation.
Can someone confirm that a service cannot receive power mode change
notifications or otherwise tell me what event could be used for this
purpose in a service?
Any help appreciated,
--
Stefan Kuhr
Stefan Kuhr
2009-07-17 06:45:34 UTC
Permalink
Hi Doron,
Post by Doron Holan [MSFT]
why is hibernate different than resume from standby?
For me it would not make any difference. So let me rephrase my original
question: How can i detect a resume from hibernation or standby from my
service?
--
S
Uwe Sieber
2009-07-17 07:12:07 UTC
Permalink
Post by Stefan Kuhr
Hi Doron,
Post by Doron Holan [MSFT]
why is hibernate different than resume from standby?
For me it would not make any difference. So let me rephrase my original
question: How can i detect a resume from hibernation or standby from my
service?
Your service needs the SERVICE_ACCEPT_POWEREVENT flag.


Uwe
Stefan Kuhr
2009-07-17 13:01:54 UTC
Permalink
Hi Uwe
<snip>
Your service needs the SERVICE_ACCEPT_POWEREVENT flag.
Great. This looks exactly like what I was looking for.

Thanks,
--
Stefan
Continue reading on narkive:
Loading...