How to Shutdown/Reboot a SP ?

B

binarylife9

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
 
P

Peter Foot [MVP]

Both the arguments are Int32 values, not Long (Which represents an Int64).
Changing these should fix your problem.

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top