C# code to soft reset a Windows Mobile device

Jun 29, 2010 | 42Gears Team

Here is the C# code to soft reset a Windows Mobile device (using P/Invoke)

[DllImport("coredll.dll", SetLastError = true)]
static extern int SetSystemPowerState(string psState, int StateFlags, int Options);

const int POWER_FORCE = 4096;
const int POWER_STATE_RESET = 0x00800000;

private void SoftReset()
{
SetSystemPowerState(null, POWER_STATE_RESET, POWER_FORCE);
}

Exclusive News and Updates on Enterprise Mobility!

Subscribe for our free newsletter

Thank you! you are successfully subscribed.
Please enter a valid official email
* I consent to receive newsletters via email from 42Gears and its Affiliates.
Please agree
* I have reviewed and agreed to 42Gears Privacy Policy and Terms of Use prior to subscribing and understand that I may change my preference or unsubscribe at any time.
Please agree

chat