SetThreadExecutionState / CallNtPowerInformation(SystemExecutionState)
- From: "jim clark" <nospam-jimc@xxxxxxxxxxxxxxxxx>
- Date: Wed, 12 Mar 2008 15:59:47 GMT
I would be very grateful if anyone could answer the following:
1. I'm using SetThreadExecutionState with flags ES_SYSTEM_REQUIRED and
ES_CONTINUOUS to prevent a system from sleeping. When I don't need the
system to stay awake anymore I call it again with only ES_CONTINUOUS set -
my understanding is that this clears the previous flags and allows the idle
counter to start working again. Sometimes however, the system still refuses
to idle after the second call - Is it possible that calling again with only
ES_CONTINUOUS set would reset the idle timer again (I don't do this very
frequently but possible once every few minutes)?
Or, to put it another way:
2. You can determine the current state by calling
CallNtPowerInformation(SystemExecutionState, ...) .If this reports that
ES_SYSTEM_REQUIRED (or similar) is set is there anyway to find which thread
(or even better just which process) has done this. I have a situation where
something is setting the flag but I don't seem to have anyway to find out
what.
Best Regards
James
.
- Prev by Date: Re: Stack overflow
- Next by Date: Re: Stack overflow
- Previous by thread: How to modify data-frame's IP address ,in passthru sample?
- Next by thread: CreateProcessAsUser and OpenGL
- Index(es):
Relevant Pages
|