LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control third party application through labview

I am trying to send keyboard commands to a third party application. I have successfully launched the app, but can't send alt+u+enter command to the app.third party app control.png

Can someone please tell me how can I accomplish this?

Thanks.

0 Kudos
Message 1 of 3
(2,551 Views)

Assuming the programmatic keyboard button presses are set correctly, it looks like the button presses are occurring before the third party application is launched and able to capture the keyboard input.

 

It looks like you are trying to place a delay of 1000 ms following the System Exec and prior to the key presses, but since the wait has no prior data dependency input, it begins to count down as soon as the VI runs.  Also, the System Exec is set to NOT wait until completion, so moves past this function almost instantaneously.  I would recommend trying to set the wait until completion to TRUE and starting the wait 1000ms after the System Exec call.  If that doesn't work try increasing the wait time.  If that doesn't work, the third party application may need window focus to pick up and respond to the key presses, which is also possible to do programmatically through LabVIEW.

0 Kudos
Message 2 of 3
(2,493 Views)

Are you sure your third party app is getting into the foreground when launched? The keyboard messages only get send to the foreground app. Launching an app by another process does normally not make that application the foreground process. So you may need to use quite a bit more of Windows API calls to wait for the new process to be fully active, determine its main window and sending that window into the forrground before attempting to simulate key presses.

Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 3
(2,474 Views)