What's happening is that a process (with proper priveledge) can issue a system shutdown request to the OS. The OS in turn issues WM_QUERYENDSESSION / WM_ENDSESSION to each window. The process that initiates the shutdown (using the SDK function ExitWindowsEx) can force each process to shutdown whether it wants to or not by using the EWX_FORCE flag in the ExitWindowsEx call, though typically you do not do this because data can be lost.
Some UPS applications (for example APC's) let you specify the exact behavior you want - i.e., wait for an app to shut itself down after being sent WM_ENDSESSION, or force apps to shutdown either immediately or after some delay. I would check your UPS software and see if you can tailor the process shutdown semantics to your liking.
I
n a CVI application, you can register a main window callback with RegisterWinMsgCallback. It's not clear (to me anyway) if this function can be made to intercept WM_QUERYENDSESSION or WM_ENDSESSION.
There is a discussion on system shutdown in the Win32 SDK provided with CVI. See the topic "System Shutdown".