You will need to poll the window status to determine when it closes. Make sure you put a delay in the poll loop to avoid eating all your processor time. If this is a UI based application, a 50ms delay will be good. I have attached a single-VI example of how you can use dynamic events to tell your program to do something else. To use dynamic events, you have to do two things - create an event and register an event. These two things happen in the first two nodes on the left of the diagram. To use a registered event, you need right-click on the border of the event structure and make sure that Show Dynamic Event Terminals is checked. Then wire your registered events into the terminal. Note that you can register more than one event. Note also that the data for the event can be anything you want (it is a boolean in this example). To fire the event, use the Generate User Event VI. The input data will be the type you specified when you create the event. Make sure you clean up your event and registration before you exit.

Your code will probably have the top loop in the example in a different VI (the one checking for whether a window is open or not). You may not want to generate an event every iteration of the poll, only when the value changes.
Message Edited by DFGray on 01-30-2007 08:23 AM