I'm designing VI's that operate high voltage devices. I don't want the user to be able to close the VI's without turning off the devices, because I don't want large, sudden voltage changes (or, y'know, devices that run at 3K volts for a week with nobody using them).
Thus, I want a VI that performs a shutdown operation before closing. A search indicates that I can make windows unclosable except by a VI's Off button; is there any other way to accomplish this?
Take a look in the example finder at the Events example called Dynamically Monitor VI's.vi it demonstrates how to capture the event of a user closing your program. So if they close it using the X in the top corner, it will capture this as an event, and you deal with it as you please. There was another thread about this very recently, I looked briefly for it but couldn't find it, maybe someone could link it for you if they find it.