Programatically log users off #135

You may be thinking how can I use this procedure. Well I used it in a program where I could send commands to a remote machine.

procedure LogOff;
begin
  ExitWindowsEx(EWX_LOGOFF, 0);
end;
Note
No "reason" code was passed to the second parameter of the ExitWindowsExfunction. This is not recommended by Microsoft – See the MSDN entry for ExitWindowsEx.
Author: Shlomo Abuisak
Contributor: Shlomo Abuisak
Added: 2009/11/05
Last updated: 2009/11/05