title: How to abort shutdown in Windows (XP|Vista) programatically?
body: <p>I want to be able to 1. detect (and, if needed 2. abort) OS shutdown from my application, preferably by using the Windows API.</p>
  
  <p>I know that it is possible to abort shutdown manually using the command <code>shutdown -a</code> In the worst case, I could ShellExecute this, but I was wondering if there was a better way to prevent the shutdown programatically.</p>
  
  <p>Maybe it would be enough to be notified programatically that the OS is about to shut down - how to do this?</p>