>>When I was closing from the Task bar, I didn't get the message - this is the behavior I'd like to simulate - the shutdown initiated by Windows (say, Windows Update).
>
>Don't let Windows Update shut down anything
Windows Update is just for example. I want this application to be properly closed if shutdown is initiated outside from the application. For now I need to properly simulate this case. My question is - what is the correct (programmatic) way of the simulation.
If it's not broken, fix it until it is.
My Blog