Shutdown Windows 98

Mark

Newcomer
Joined
Sep 22, 2003
Messages
23
Location
Italy
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
 
For Win98 this should do it:
Visual Basic:
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.
 
Thank you

I will try your code monday at work (at home i have XP and 2000).
In every case THANK YOU!
 
Back
Top