2/14/2007

Applications can cause the device to suspend by simulating a press of the Power key, which makes two calls to the Windows Embedded CE keybd_event function, as shown in the following code:

Copy Code
keybd_event(VK_OFF,0,KEYEVENTF_SILENT,0);
keybd_event(VK_OFF,0,KEYEVENTF_SILENT | KEYEVENTF_KEYUP,0);
sleep(60);

The sleep statement allows time for the system to suspend and prevents your application from executing further.

See Also