title: vb6 Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) does not work
body: <p>I am trying to catch when Microsoft Windows Task Manager is closing the application. I know there are these UnloadMode possibilities:
      '0   The user has chosen the Close command from the Control-menu box on the form.
      '1   The Unload method has been invoked from code.
      '2   The current Windows-environment session is ending.
      '3   The Microsoft Windows Task Manager is closing the application.
      '4   An MDI child form is closing because the MDI form is closing.</p>
  
  <p>Code:</p>
  
  <pre><code>Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  '[do saving]
  End Sub
  </code></pre>
  
  <p>But it does nothing when I close application using task manager. If I close using Close button - it saves all what I need. Where is the problem?</p>