title: Abort Windows log off from Java
body: <p>I have an Swing application in which the user can create and save documents. The application is deployed as a simple Jar-file.</p>
  
  <p>The primary target platform is Windows Vista.</p>
  
  <p>If the user has on opened and non-saved document in the application and the user is logging out from the Windows Vista machine I would like to halt the logging off process and ask the user if he wants to save to document before the Java application is terminated.</p>
  
  <p>Is it possible to halt the logging off process on Windows Vista from an Java application?</p>
  
  <p>I've tried the shutdown hook with no success.</p>