1. Home
  2. C# code to soft reset a Windows Mobile device

C# code to soft reset a Windows Mobile device

KB ID: 42G2012335
Views: 108
Updated: June 2021

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);
}

For more details on our products, click here 
If you need further assistance, please submit a ticket here