简体   繁体   中英

Multiple Exes running in WPF Application

My Solution has 3 wpf applications, each an exe. The main exe (called as Parent) has a menu from where I want to call (open) the other two exes. I am able to do that by process.start (myexe) and assign it to the window handle of the parent application.

However, I want the new exe to be opened inside a particular content control (or a tabitem, or a prism region) of my wpf mainwindow. I also tried using Prism but I am unable to assign the exe's mainview to a region.
I am not able to get the view (usercontrol) from child process's handle and assign it to a contentcontrol of the main view of the parent application.
The final result in any case should have multiple exes opened in the task manager (which I have achieved) but they are floating inside the Parent App, My main intent is to show them inside some designated control in the main app.



Can someone guide how this can be achieved?

If you have absolutely no choice then you can use something like this which is already made for you. https://www.codeproject.com/Tips/673701/Hosting-EXE-Applications-in-a-WPF-Window-Applicati

You define the control that will host the application in xaml.

<local:AppControl x:Name="appControl" />

Then in the code behind (or another way) you specify the path to the exe you want embed:

appControl.ExeName = "notepad.exe";
this.Unloaded += new RoutedEventHandler((s, e) => { appControl.Dispose(); });

There's also this Hosting external app in WPF window which is very relevant to what you want to do.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM