I have small app with a Window that is listening for the WM_QUERYENDSESSION message and returning FALSE - which should tell Windows that I don't want it to shutdown (see this MSDN link).
What I have found is that even though I am asking Windows to not shutdown, and Windows is itself not shutting down, it is still sending the WM_ENDSESSION message and closing other applications that are running alongside my own.
Does anyone know why this is happening and what can be done so that my application also prevents other applications from shutting down?