Windows just starts sending every app a WM_QUERYENDSESSION message then, assuming nothing attempts to block shutdown, sends everything an WM_ENDSESSION message. Apps have to respond in a timely fashion to these messages or Windows will just kill them The end result of this is that there is no defined order of apps shutting down and you should never ever try to rely on one.
I wasn't even thinking of relying on one, I was just wondering if there were any measures to mitigate slow to shut down applications by starting them shutting down first. (Possibly leaving resources free for that app to shut down before kicking everything else off).
I imagine it's almost impossible to calculate which apps will be slow to shut down, so I don't suppose it's worth it.