all groups > dotnet compact framework > november 2007 >
You're in the

dotnet compact framework

group:

How to Shutdown/Reboot a SP ?



How to Shutdown/Reboot a SP ? binarylife9@gmail.com
11/29/2007 9:34:02 AM
dotnet compact framework: hello,

i am trying this code on WM5 Emulator and its not working, it throws a
notsupported exception. i tried on my WM5 Device and its not working.

can anybody tell how to Shutdown/Reboot a SP ?


Private Declare Function ExitWindowsEx Lib "Coredll.dll" Alias
"ExitWindowsEx" (ByVal uFlags As Long, ByVal dwReserved As Long) As
Int32

'To Shutdown
ExitWindowsEx(EWX_SHUTDOWN, 0)

'To Reboot
ExitWindowsEx(EWX_REBOOT, 0)


thanks,
Re: How to Shutdown/Reboot a SP ? Peter Foot [MVP]
11/29/2007 9:44:10 PM
Both the arguments are Int32 values, not Long (Which represents an Int64).
Changing these should fix your problem.

Peter

--
Peter Foot
Microsoft Device Application Development MVP
www.peterfoot.net | www.inthehand.com
In The Hand Ltd - .NET Solutions for Mobility

[quoted text, click to view]
AddThis Social Bookmark Button