I am trying to adapt the code posted in this question: https://stackoverflow.com/a/44059700
to allow me to embed a Unity3D app inside a WPF app.
This is my s
Use a WindowsFormsHost
or HwndHost
control in your WPF. The hwnd is in the host control's Handle
property. So you can change this line to put Unity in just the host control.
process.StartInfo.Arguments = "-parentHWND " + hwndHost.Handle.ToInt32() + " " + Environment.CommandLine;
And remove the code that gets the hwnd for the floating frame
HwndSource source = (HwndSource)HwndSource.FromVisual(p);