Add the following API Declares and Constants to
a BAS Module:
Declare Function ExitWindowsEx& Lib "user32" (ByVal uFlags&, ByVal
wReserved&)
Global Const EWX_FORCE = 4 'constants needed for exiting Windows
Global Const EWX_LOGOFF = 0
Global Const EWX_REBOOT = 2
Global Const EWX_SHUTDOWN = 1
Then you Shutdown/reboot/logoff windows with the following call:
lresult = ExitWindowsEx(EWX_SHUTDOWN, 0&) 'shut down the computer
Note: Replace the first parameter of the ExitWindowsEx function call
with the appropriate CONSTANT.
[sig][/sig]