Shutdown / Logout aborts when closing application

  • Thread starter Thread starter Robert
  • Start date Start date
R

Robert

I have encountered a strange behaviour of the windows shutdown / logoff
procedure when any of two specific applications is running at that time.
Although the application terminates, and the process disappears from the
process list, the shutdown will not continue. It will not even complete
terminating all the other programs, in some cases.
Also, the fact that I can then start new programs indicates that the
shutdown was truly aborted.

However, the programs do not use the AbortSystemShutdown API call or
anything like it! So for what reason could the shutdown still be aborted?

All suggestions welcome

Robert
 
Could they be returning 0 when processing the WM_QUERYENDSESSION message?
That might stop the shutdown if attempting to shut down Windows internally
calls ExitWindowsEx() with EWX_FORCEIFHUNG.
 
Not directly, but thanks: You gave me the right idea.
Since it's a VB application, there is no way to process WM_QUERYENDSESSION
directly, but I cancelled application termination first, in order to gain
time for a proper application shutdown. So the system thinks that the
application cannot terminate. Sigh...

Thanks again

Robert
 
Back
Top