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] <binarylife9@gmail.com> wrote in message
news:03cb73b7-c2e4-48dd-8cef-e0054ea25651@s8g2000prg.googlegroups.com...
> 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,
> AB