Andrey Yatsyk (andrew@softspb.com), October 08, 2001.
How to suspend Pocket PC device from my embedded Visual C++ program? I need the same effect as pressing "Power Off" button.
There are two ways of device suspension on Pocket PC. The first one is to emulate pressing on power off button. On Pocket PC this button has a key code as any other one. The device will be suspended after execution of following code:
When the application has been turned on the execution of your program continues from line follows keybd_event code.
The other way of application suspension is to use undocumented PowerOffSystem() function. As this function is undocumented I can't make any assumptions abut support of this function in different devices or operating system versions. In order to use this function place following function declaration into your source code:
You can simply invoke PoverOffSystem() from your code after that.