I'm trying to use this code (provided by GTO - thanks) to shut down my computer:
"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."
This works for restarting but not for shutting down. Anyone help me? Remeber I'm using WIN 2000!
Thanks
elziko
"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."
This works for restarting but not for shutting down. Anyone help me? Remeber I'm using WIN 2000!
Thanks
elziko