BCX Console Demonstration Program s114.bas

'  ****************************************************************** 
'  EWX_FORCE Forces processes to terminate. When this flag is set, 
'  Windows doesn't send WM_QUERYENDSESSION and WM_ENDSESSION messages to 
'  running applications in the system. This can cause the applications to 
'  lose data. Therefore, you should only use this flag in an emergency. 
' 
'  EWX_LOGOFF Shuts down all processes running in the security context of the 
'  process that called the ExitWindowsEx function and logs the user off. 
' 
'  EWX_POWEROFF Shuts down the system and turns off the power, if supported. 
' 
'  EWX_REBOOT Shuts down the system and then restarts the system. 
' 
'  EWX_SHUTDOWN Shuts down the system to a point at which it is safe to 
'  turn off the power. All file buffers have been flushed to disk, and 
'  all running processes have stopped. 
'  ****************************************************************** 

ExitWindowsEx(EWX_LOGOFF, 0)

Result:

Result not displayed for this example.