Tuesday, June 12, 2007

Preventing the device from turning off

One question a lot of people ask is how to prevent the device from turning itself off?

You can either call the SHIdleTimerReset function in aygshell.dll:

[DllImport("aygshell.dll")]
private static extern void SHIdleTimerReset();

See here for more information on the API: http://msdn2.microsoft.com/en-us/library/ms835757.aspx

Or use the already wrapped method defined in OpenNETCF.WindowsCE.PowerManagement.ResetSystemIdleTimer();

Of course the function needs to be called periodically before the timeout threshold. http://www.opennetcf.org/

1 comment:

Joel Ivory Johnson said...

What is the difference in using this and SystemIdleTimerReset()?