05-18-2010 03:04 PM - edited 05-18-2010 03:05 PM
Solved! Go to Solution.
05-18-2010 03:15 PM
You would use the <Application> Application Instance Close? and/or the <This VI> Panel Close? filter events.
Jim Kring has a nice blog entry on this subject:
Controlling the Exit of Built Applications
05-18-2010 03:26 PM
05-18-2010 03:51 PM - edited 05-18-2010 03:55 PM
Gordal wrote:
Are there similar ways to do this in non-built applications? When developing.
Yes. Select <This VI> instead of <Application> when adding a new event. Some sub-selections for This VI are: Key, Mouse, Menu, Panel Close, Panel Resize. Select Panel Close to capture when someone clicks on the X in the upper right corner of the front panel. You can use Panel Close? to trap the event and wire a True to the discard terminal to prevent the user from closing the panel with the X.
You can also use <Application> - Application Instance Close? to trap when a user clicks on File - Exit.
05-18-2010 10:25 PM
Does it have to be event based?
it coulb be as simple as a state machine architecture
Startup State->Main Code->Shutdown State
05-19-2010 08:36 AM
falkpl wrote:Does it have to be event based?
it coulb be as simple as a state machine architecture
Startup State->Main Code->Shutdown State
Based on the original poster's question, yes.
A state machine by itself can't capture events such as the application close, you need to use the event structure.(closed as in the user clicks the top right corner 'x').