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

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?
 
P

Paul G. Tobey [eMVP]

Hang on. You did the idle timer reset and it still locked up and
disconnected you? I don't think so.

Paul T.
 
G

Guest

You must call SystemIdleTimerReset periodically, not just once. The period
must also be smaller than the system timeout is set for.
 
H

Hilton

Looks like there is a bug in that code. The "== 0" should be "> 0" in
EnableSuspend.

Hilton
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top