Does anyone know how to detect external application window close?

I can detect VI's panel close but not the ones from other programs. In this case, I know the title of the window and need to detect this event to trigger other actions. I tried to use event structure by registering dynamic events, but with no success. I would appreciate it if someone can help me or tell me where I can find related articles.

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
This account is no longer active. Contact ShadesOfGray for current posts and information.
Attachments:
SimpleDynamicEventExample.vi ‏13 KB
SimpleDynamicEventExample.png ‏8 KB

Similar Messages

Maybe you are looking for

  • ODT 10.1.0.2.0 on Visual Studio 2003 problem

    I have installed the ODT 10.1.0.2.0 on Microsoft Windows XP sp2, Visual Studio 2003 and database Oracle v9.2.0.7.0. I have create the example project like the example in http://www.oracle.com/technology/oramag/oracle/06-sep/o56odp.html, bat when I ex

  • Report based on sql or plsql

    Hello, I have an LOV_COLS, which contains the columns of scott.emp and is represented by a list P50_MY_COLS, and textfield P50_SEARCHTERM where I can enter a search term. Now I like to have a report which displays something like SELECT EMPNO, ENAME,

  • Need help in the CRM Business Package Configuration in EP

    Hi, I have uploaded CRM BP 60.2.3 on EP 6.0 WAS 6.40. I have configured and assigned the WAS System parameters and CRM System parameters. But still, when I preview an iview for ex. B2B Shop, the following portal runtime error is coming. Portal Runtim

  • Iozone website benchmark results on Xserve RAID

    Hi, I'd like to try and find out how the Apple RAID was configured for the iozone benchmark. The results of the benchmark are here: http://www.iozone.org/src/current/Xserver.xls I asked the question directly to iozone and the answer was that the benc

  • How to install InDesign upgrade over PageMaker upgrade

    Perhaps I'm the only one in the world with this problem (so I've been told by customer support) but here goes... I purchased PageMaker version 5 back around 1997. Since then, I purchased several upgrades so that I'm now at PM version 6.5. I just purc