We can use the API SetSystemPowerState to reset the Windows Mobile device. The following code resets the device.

#include
#include

int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
if(IDYES == MessageBox(NULL,TEXT("Are you sure to reset the device?"),TEXT("Reset"),MB_YESNO | MB_ICONQUESTION))
{
SetSystemPowerState(NULL,POWER_STATE_RESET,0);
}
return (int)0;
}

We can use following values instead of POWER_STATE_RESET
POWER_STATE_ON
POWER_STATE_OFF
POWER_STATE_CRITICAL
POWER_STATE_BOOT
POWER_STATE_IDLE
POWER_STATE_SUSPEND
POWER_STATE_RESET

The last parameter can be 0, POWER_FORCE or POWER_DUMPDW. The POWER_FORCE parameter indicates the state change is urgent, and the POWER_DUMPDW will generate Dr. Watson report.

Please note that some of the power state may not work in all the platforms. Different platforms may restrict the use of some of the power states