There are occasions to interrupt a user generated Windows Shutdown, discard the event, and generate a Windows Shutdown event at a later point (e.g. to allow an acquisition to finish). This is not always possible within the Event case for Application Instance Close? (e.g. an acquisition is non-deterministic).
Why not add a Windows Shutdown event to the event structure and allow me to discard it? Can you also write a VI to generate a Windows Shutdown?
According to an NI applications engineer:
"The Application Instance Close? event triggers when LabVIEW application is closing. It does not tell you if Windows is shuting down. The only way to know when Windows is shuting down is to trap the WM_QUERYENDSESSION message that you were talking about yesteray. I have consulted with a R&D engineer to see if there's any way to do this in LabVIEW. The only possible solution we can think of is to write an .NET program that can trap the WM_QUERYENDSESSION message and trigger a event callback that you can register in LabVIEW using "Register Event Callback" VI . None of the engineers I've talked to have done this yet, so I cannot garantee if this will work."
Wouldn't it be more elegant to do this in LabVIEW?