Hi Knic, On 17/10/2007, at 9:23 PM, knic knic wrote: > I am running the PythonCE release pythonce-2.5-20071004 on a WM 6 > phone. I was > wondering how do I enable python programs to run and not sleep when > the > screen is turned off?
Are you using a Windows Mobile 6 Standard (i.e. non touchscreen), or Windows MObile 6 Professional (i.e. touchscreen enabled) device? I assume by screen turning off you are actually talking about the entire device turning off and the power button needing to be pressed to turn it back on. There is actually an "unintended" state a device could get into where the screen is off, but the CPU is still running, but since you say your application stops running I am assuming the entire device is powering down. If using a Windows Mobile 6 Professional device the answer is to use the ctypes module to periodically call an operating system API called SystemIdleTimerReset. This API is documented within MSDN at http:// msdn2.microsoft.com/en-us/library/ms941840.aspx, basically each time you call this function it resets a timer. If the timer is not reset and expires the device suspends. So by calling the function periodically within a main loop of your program etc the device shouldn't turn off. I don't have a code example for doing this on hand, but could probably sort something out if you are interested in this technique. Hope this helps, Christopher Fairbairn _______________________________________________ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce