Mark Posted October 4, 2003 Posted October 4, 2003 Hi! First sorry for my english, i'm italian..i hope you understand :) I saw a thread about the use of "ExitWindowsEx" function in VB.NET. I need more informations about this function (or another similar one), because i have to write a vb.net application that is able to shutdown a pc with Windows 98 SE. How could i do it? Have you got an example code to close all processes and shutdown PC ? Thank you very much. Mark Quote
*Experts* mutant Posted October 4, 2003 *Experts* Posted October 4, 2003 For Win98 this should do it: Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Integer, ByVal dwReserved As Integer) As Integer 'constant names speak for themselves : ) Const EWX_LOGOFF = 0 Const EWX_SHUTDOWN = 1 Const EWX_REBOOT = 2 Const EWX_FORCE = 4 'then in some sub or function ExitWindowsEx(EWX_REBOOT, 0) 'or whichever you want to do Note that this will not work on Win2000 and NT type of OSs. Quote
Mark Posted October 4, 2003 Author Posted October 4, 2003 Thank you I will try your code monday at work (at home i have XP and 2000). In every case THANK YOU! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.