ShutDownWin9X



Const EWX_LogOff As Long = 0
Declare Function ExitWindows Lib "User32" Alias "ExitWindowsEx" _
(ByVal dwOptions As Long, ByVal dwReserved As Long) As Long

'2. Add this code to where you want to shut down from (eg. Command1_Click):


ExitWindows EWX_LogOff, &HFFFFFFFF
'This code will only work from an EXE file. That means that you will have to

'compile this fila as an EXE, and if you want to save this project. When the

'project is compiled, close all instances of VB you have open, and probably

'all other programs you would have open. Run the EXE, and click on Command1

'(or whatever you made the trigger as). The Windows session should shut down

______________________________________________________________________

(shutdownwin9x.html)- by Paolo Puglisi - Modifica del 25/3/2019