I need a simple application that shows how to embed an external application in a WPF object. The external application to be used is MUGEN. The application needs to be written in C# and in the form of a VS 2010 solution.
For information on MUGEN see www.elecbyte.com. It is a win32 application that can be run from the command line with parameters.
The requirements of the project are as follows:
1. Create a basic WPF application.
2. Have one text box to accept arguments for launching the executable.
3. Have one button that launches the application (MUGEN) with the command line arguments captured in the text box (step2)
The external application needs to be embedded in the WPF. It should resize with the form if possible. If not lock the size of the form.
To embed the application the following steps can be used as a guide:
1. Create a WindowsFormsHost and add it to a panel in your UI
2. Start the process (such as MUGEN) using [url removed, login to view]
3. Call [url removed, login to view]
4. Use [url removed, login to view] to get the window handle
5. Call SetWindowPos to set the process's window to the coordinates and Z Order of the HwndHost window
6. Hook both the HwndHost and the [url removed, login to view] to detect size changes and repeat step 5.
The effect is the entire MUGEN window (or whatever application you started) appears and behaves exactly as if it were part of your WPF application.