LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I run an *.exe application in a container from within LabVIEW?

I have an *.exe that was created in a different programming environment. How do I launch this application from within LabVIEW so that the application window is contained in a subpanel or container on the LabVIEW front panel.
0 Kudos
Message 1 of 2
(2,716 Views)

niuser10 wrote:
I have an *.exe that was created in a different programming environment. How do I launch this application from within LabVIEW so that the application window is contained in a subpanel or container on the LabVIEW front panel.

If it is an ActiveX or .Net Control you most easily integrate it using the according LabVIEW Container UI component. If it does not provide either of these interfaces the only option is to parent the main window. This requires calls to Windows API functions such as SetParent(). However it is tricky at best.

 

Each application has an internal message loop and if an application does do something special in its message loop, parenting its main window can and often does cause havoc. So it is not a recommended apprach to do, since doing it is quite a bit of work with trying to find the right Windows APIs and once you have done the tedious work you do have a good chance that it will not work seemlessly.

 

Is that worth the effort for you? If so you can try but be prepared that it might not work anyhow and that there is no way to make it work unless you have the source code to the other application and time and knowledge to tinker with it.

 

Also this is a pure Windows only solution. There is a small possibility that it could be done on other platforms with their respective window manager but to my knowledge nobody has tried that so far.

 

In most cases however such parenting is not really necessary and often even only confuses the end user. Think good about it and if possible at all, spare yourself a lot of frustration and hassles and go with a different solution.

Message Edited by rolfk on 10-19-2009 09:02 AM
Rolf Kalbermatter
My Blog
Message 2 of 2
(2,709 Views)