title: Suspend Windows Shutdown until application finished it´s work VB.Net
body: <p>i wrote a little desktop utility which automatically detects an USB Stick which contains updates for antivirus patterns and software packages. It can either perform those updates on detection or on system shutdown/restart and here comes the problem...
  I am not able to get the suspended shutdown to work properly..
  If i am using this code my application sucessfully blocks the windows shutdown, but won´t perform the updating process.</p>
  
  <pre><code>    ' &gt;&gt;&gt;&gt;Process Windows Shutdown&lt;&lt;&lt;&lt;
      If m.Msg = WM_QUERYENDSESSION OrElse m.Msg = WM_ENDSESSION Then
  
          ShutdownBlockReasonCreate(Me.Handle, "Performing #### and Kasperksy Updates...")
          UnZipKit()
          ShutdownBlockReasonDestroy(Me.Handle)
          Return
  
      End If
  </code></pre>
  
  <p>I already found out that i need to return FALSE somewhere, but i can´t figure out how. The Microsoft statement can be found here: <a href="https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms700677(v=vs.85)" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms700677(v=vs.85)</a></p>
  
  <p>As for additional information, if i won´t include the RETURN windows shutdown won´t be delayed what so ever...</p>