PDA

View Full Version : Disabling Auto-Power off


Smooser_Moves
18th June 2004, 01:43 AM
The application I'm developing needs the device to always remain on, even until the battery runs out, so I need to disable the auto power off feature if it has been enabled.

I've tried using
SystemParametersInfo(SPI_SETBATTERYIDLETIMEOUT,... );
but it just doesn't work. Returns success but nothing changes, not even the registry keys where the values are held. I found the registry settings in HKLM\System\CurrentControlSet\Control\Power\Timeou ts, and played around with setting them, but they aren't picked up until a soft reset occurs which isn't a viable solution.

So the first thing I need to know is what the difference between the reg keys
HKLM\System\CCS\Control\Power\Timeouts\BattSuspend Timeout:dword
and
HKLM\System\CCS\Control\Power\BattPowerOff:dword
are.

They both seem to contain the same value, and similar names.

The second thing I need to know is what needs to be done to notify the system that the idle timeout has changed, and to reload the value from the registry. I tried an HWND_BROADCAST of WM_SETTINGCHANGED but to no avail. How does the system dialog where you can change the idle timeouts inform the system those values have changed??

Thanks,
Timbo.