Hi,
I need to restart windows CE from within my application. Does anyone know how to do this? Im using vb.net compact.
Thanks,
Tim
Printable View
Hi,
I need to restart windows CE from within my application. Does anyone know how to do this? Im using vb.net compact.
Thanks,
Tim
This class will do it
VB Code:
Imports System.Runtime.InteropServices Public Class DeviceReboot <DllImport("coredll")> _ Private Shared Function SetSystemPowerState( _ ByVal psState As String, _ ByVal StateFlags As Integer, _ ByVal Options As Integer) As Integer End Function Const POWER_STATE_ON As Integer = &H10000 Const POWER_STATE_OFF As Integer = &H20000 Const POWER_STATE_SUSPEND As Integer = &H200000 Const POWER_STATE_RESET As Integer = &H800000 Public Sub New() End Sub Public Function Reboot() Try SetSystemPowerState(Nothing, POWER_STATE_RESET, 0) Catch ex As Exception Throw New Exception(ex.Message) End Try End Function End Class
cool. Sorted me again!
just a as a point to note.....
the reboot worked fine for me on the devices we use Psion Workabout Pro,
but i've also tried it on the PSC Falcon and the reboot option didnt work.
i have other code to make this work if you are using PSC and the class posted above doesnt work
cheers. Worked fine on my device.