Hi,

I am working on an application which must run all the time after it has
started. Essentially this would mean that device should never suspend/power
off when on battery. This is very critical to the functionality of the
application. The targetted device is Motorola HDT600 based on WinCE 4.2.

I have identified a few options that could prevent the device from sleeping:

Option-1
----------
Under "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\" key set
"DisableGwesPowerOff" to non-zero. As per the documentation, if
DisableGwesPowerOff is set to non-zero, Power Manager will ignore the
settings described in Option-2.

Option-2
------------
Under "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power" key, set
"BattPowerOff" to zero. This is similar to changing the Control Panel Power
applet setting to "Never".

Option-3
------------
Under "HKEY_LOCAL_MACHINE \System\CurrentControlSet\Control\Power\Timeouts"
key, set "BattSuspend" to zero.


Now my doubts are:
1) Why do we have so many different options for this?
2) What would be the tradeoff between option 2 and option 3? i.e. if we
programatically go for option 3 but user goes to control panel power applet
and makes changes there?
3) What would be the better way of doing it?

We have already decided NOT to use other methods like periodically calling
SystemIdlePowerReset() and sending fake keyboard events from a different
thread.

Thanks in advance.

regards,
Dapi

Re: Power management options ? by gerrit

gerrit
Thu Sep 29 08:36:22 CDT 2005

Dapi, I think I can help clarify.

GWES used to handle all of this. Now PM component has a more advanced
implementation. One of the two needs to be disabled so they don't
conflict. The default is GWES Power control is disabled as per your
Option 1.

Next, as stated in the documentation (which actually makes sense after
you read it a few times) The actual decision to manage system power is
based on the presence of ACUserIdle subkey under "HKEY_LOCAL_MACHINE
\System\CurrentControlSet\Control\Power\Timeouts"

So you have 2 options as I see it.
1- remove ACUserIdle subkey under "HKEY_LOCAL_MACHINE
\System\CurrentControlSet\Control\Power\Timeouts"

2- Just set all the timeouts (ACUserIdle, ACSystemIdle, ...) to 0.

Gerrit