Prevent light-off/key-lock/suspend/standby

  • Thread starter Thread starter cyberco
  • Start date Start date
C

cyberco

My application has to upload quite some data, which takes a long time.
In the meantime the device goes into 'suspend' mode (at least the light
turns off and the keypad gets locked). The side-effect is that the
network connection is broken as well (at least the WiFi connection).
How to prevent 'suspend' can be found here:

http://msdn2.microsoft.com/en-us/library/z4k4wb9k(VS.80).aspx

But that didn't solve my problem. How can I prevent the screen from
going black and the keys from becoming locked?
 
Hang on. You did the idle timer reset and it still locked up and
disconnected you? I don't think so.

Paul T.
 
You must call SystemIdleTimerReset periodically, not just once. The period
must also be smaller than the system timeout is set for.
 
Looks like there is a bug in that code. The "== 0" should be "> 0" in
EnableSuspend.

Hilton
 
Back
Top