title: Detecting system shutdown or logoff
body: <p>How can I detect when a system is shutting down or logging off with AutoIt?</p>
  
  <p>I need to run a function if the computer is shutdown or logged off while my script is still running.</p>