10-19-2009 01:38 AM
10-19-2009 01:59 AM - edited 10-19-2009 02:02 AM
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.