home *** CD-ROM | disk | FTP | other *** search
/ PC Active 2002 December / pca1412.iso / SOFTWARE / SystemTools / Systools.exe / Logoff / LOGOFF.C next >
Encoding:
C/C++ Source or Header  |  1997-05-18  |  1020 b   |  20 lines

  1. #include <windows.h>
  2. //#include <winuser.h>
  3.  
  4. int main(int argc, char *argv[])
  5.  
  6. //    EWX_FORCE    Forces processes to terminate. When this flag is set, 
  7. //                Windows does not send the messages WM_QUERYENDSESSION and WM_ENDSESSION 
  8. //                to the applications currently running in the system. This can cause the applications to lose data. 
  9. //                Therefore, you should only use this flag in an emergency.
  10. //    EWX_LOGOFF    Shuts down all processes running in the security context of the process 
  11. //                that called the ExitWindowsEx function. Then it logs the user off.
  12. //    EWX_POWEROFF    Shuts down the system and turns off the power. 
  13. //                    The system must support the power-off feature.
  14. //    EWX_REBOOT    Shuts down the system and then restarts the system. 
  15. //    EWX_SHUTDOWN    Shuts down the system to a point at which it is safe to turn off the 
  16. //                    power. All file buffers have been flushed to disk, and all running processes have stopped.
  17. {
  18.     ExitWindowsEx(EWX_LOGOFF, 0);  //second parameter is ignored
  19.     return 0;
  20. }