Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

2 views
Skip to first unread message

cyberco

unread,
Dec 14, 2006, 4:27:43 PM12/14/06
to
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?

Paul G. Tobey [eMVP]

unread,
Dec 14, 2006, 4:56:53 PM12/14/06
to
Hang on. You did the idle timer reset and it still locked up and
disconnected you? I don't think so.

Paul T.

"cyberco" <cyb...@gmail.com> wrote in message
news:1166131663.1...@n67g2000cwd.googlegroups.com...

<ctacke/>

unread,
Dec 14, 2006, 5:13:21 PM12/14/06
to
You must call SystemIdleTimerReset periodically, not just once. The period
must also be smaller than the system timeout is set for.


--
Chris Tacke
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--


"cyberco" <cyb...@gmail.com> wrote in message
news:1166131663.1...@n67g2000cwd.googlegroups.com...

Hilton

unread,
Dec 15, 2006, 6:04:15 AM12/15/06
to
Looks like there is a bug in that code. The "== 0" should be "> 0" in
EnableSuspend.

Hilton


"cyberco" <cyb...@gmail.com> wrote in message
news:1166131663.1...@n67g2000cwd.googlegroups.com...

cyberco

unread,
Dec 15, 2006, 3:58:30 PM12/15/06
to
That is indeed a bug.
I found a better example of using the native SystemIdleTimerReset
method here:

http://www.pinvoke.net/default.aspx/coredll/SystemIdleTimerReset.html

It uses a Timer object that you can dispose at any time.

On Dec 15, 12:04 pm, "Hilton" <nos...@nospam.com> wrote:
> Looks like there is a bug in that code. The "== 0" should be "> 0" in
> EnableSuspend.
>
> Hilton
>

> "cyberco" <cybe...@gmail.com> wrote in messagenews:1166131663.1...@n67g2000cwd.googlegroups.com...

0 new messages