I am no sure how Windows does it but you can do that like an MDI application which takes a screenshot and sets at the background and launches a Modal Dialog with shutdown options.

Its an Image because of a simple reason that

You start your application which just loops through seconds and displays the time and then move it to the corner and then hit shut down and you will see that your time is not increasing and then cancel that dialog and you will see that your programming was running in the back of the shutdown screen.