LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to programmatically press enter or yes to close a dialog box in an external application?

I am using Labview 8.0 and the Run Application and Close Application VIs in the Winevent.llb.  This works fine except that when certain external applications close they pop up a dialog box asking the user to click "Yes", "Cancel" or  "OK".  How can I make Labview click the "Yes" button in this case.  VB has a send keys command, but I never really got that to work for this type of case.  Thanks.

0 Kudos
Message 1 of 3
(3,148 Views)
Some applications, excel workbooks for example, have an option to save before closing.  You can either wire that true or false to prevent the popup.
0 Kudos
Message 2 of 3
(3,140 Views)
Unfortunately my application was not Excel.  I did however solve the problem:

I Used the Show Window.vi from WINUTIL.llb to get focus on the Application Window, then used the Delay function in LV 8.0 to wait 0.1 sec, then used the simulate_keyboard.vi to send a return. I lost the link to it, but this is the improved? version (http://forums.ni.com/attachments/ni/270/837/1/simulate_keyboard_modified.vi).  Although the dialog box briefly appears and beeps it works good enough for now.

Andy
0 Kudos
Message 3 of 3
(3,135 Views)