views:

151

answers:

2

I have an application for PDAs with a long running process, and I'm getting the problem that the PDA is going to sleep before the process has completed.

I haven't got any control over the power settings on the PDA, does anyone know a good way for my application to stop the PDA from going to sleep?

Many thanks

+5  A: 

You need to make a function that calls SystemIdleTimerReset, SHIdleTimerReset and simulates a key touch. Then you need to call it on a regular basis from within your application.

For an example in C++, look here:

http://stackoverflow.com/questions/246407/disable-sleep-mode-in-windows-mobile-6

Graham Bellows
+4  A: 

Have a look at:

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

Geoff
SystemIdleTimerReset seems like the way to get it workinghttp://msdn.microsoft.com/en-us/library/aa930260.aspx
Iain Hoult