The information in this article applies to:
SUMMARYWhen you are doing serial communications, a device may suspend power based upon a time limit configured by the user. The operating system determines idle time based only upon any type of keyboard entry on the device. This article explains how to keep a Windows CE device alive while you are communicating. MORE INFORMATIONTo determine the time limit that has been configured by the user, you can query the following registry key: The BattPowerOff value is a DWORD that represents how long (in seconds) the Handheld PC will wait before suspending itself. There are two methods to prevent this suspension. Method 1To avoid device suspension, an application can send a keystroke using keybd_event(). Even sending an UP keystroke, you may still get a keyboard click, so use KEYEVENTF_SILENT to prevent the click from occurring. You should send a key that is currently not being used by the Windows CE operating system so that you can eliminate any potential keyboard conflict. In the following example, an F4 UP keystroke is sent:
Method 2A better solution is to use the API SystemIdleTimerReset() from Coredll.dll. This does not disable the timeout, but resets the idle timer count back to zero. Since the minimum idle timer you can set is one minute, calling this API at intervals of less than one minute will prevent the device from entering suspend mode.Additional query words: Advanced Power Management Sleep
Keywords : kbWinCE |
Last Reviewed: January 28, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |