Guest mrsenang Posted July 16, 2005 Report Share Posted July 16, 2005 :) hiii, im a newbie for programming on windows ce base smartphone can anybody help me for to make code script turnoff device on smatrtphone with vb.net or c#.net plsss help many thanks!!! :D :D Link to comment Share on other sites More sharing options...
Guest mgama Posted July 16, 2005 Report Share Posted July 16, 2005 The API to call is ExitWindowsEx. Here is a previous newsgroup thread on this topic. http://groups-beta.google.com/group/micros...82055d5ba4c6d5a Link to comment Share on other sites More sharing options...
Guest mrsenang Posted July 16, 2005 Report Share Posted July 16, 2005 i find on this group " http://groups-beta.google.com/group/micros...5ba4c6d5a" using method with c++ but i looked for c# or vb.net language?????can anyone help Link to comment Share on other sites More sharing options...
Guest mrsenang Posted July 16, 2005 Report Share Posted July 16, 2005 hiiii i used this code on my programm to turnoff the device on smartphone 2003: ' Public Declare Sub GwesPowerOffSystem Lib "Coredll" () Private Sub ShutDown() If MsgBox("Shutdown device now?", vbYesNo, "Shutdown") = vbNo Then Exit Sub GwesPowerOffSystem End Sub ' but when i compiled this code debuger say "GwesPowerOffSystem" < Link to comment Share on other sites More sharing options...
Guest mgama Posted July 17, 2005 Report Share Posted July 17, 2005 (edited) You can use p/invoke to call ExitWindowsEx from C#. Towards the end of the Google thread, they provide the function definition. It should look a little something like this (I haven't tested it): [DllImport("user32.dll")] static extern bool ExitWindowsEx(uint flags, uint reason); // Flags: (just a few of the flags defined in winuser.h) const uint EWX_SHUTDOWN = 0x00000001; const uint EWX_REBOOT = 0x00000002; // Reasons (just a few of the reasons defined in Reason.h) const uint SHTDN_REASON_MAJOR_OTHER 0x00000000 const uint SHTDN_REASON_MAJOR_NONE 0x00000000 const uint SHTDN_REASON_MAJOR_HARDWARE 0x00010000 const uint SHTDN_REASON_MAJOR_OPERATINGSYSTEM 0x00020000 const uint SHTDN_REASON_MAJOR_SOFTWARE 0x00030000 const uint SHTDN_REASON_MAJOR_APPLICATION 0x00040000 const uint SHTDN_REASON_MAJOR_SYSTEM 0x00050000 const uint SHTDN_REASON_MAJOR_POWER 0x00060000 Edited July 17, 2005 by mgama Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now