- Home /
Set the parent of an external application window to a Unity UI element (specifically, Panel)
I need to attach (i.e. dock) an external application window to a Unity Panel using Win32 SetParent function. I have been able to do this in Visual Studio with Windows Forms using C#. Basically, the solution with WinForms was to run the process and then set the parent of the process window to the panel (see code below):
Process myAPP = Process.Start ("Calculator.exe");
myAPP.WaitForInputIdle();
SetParent (myAPP.MainWindowHandle, panel1.Handle);
I can't seem to figure out how the third line can be implemented in the case of Unity Panel.
I have tried several things but no success yet. The following line ( as well as different variations of it) gives the following error:
SetParent (myAPP.MainWindowHandle, Panel);
Error CS1503 Argument 2: cannot convert from 'UnityEngine.GameObject' to 'System.IntPtr'
Many thanks in advance for your time and help.
By the way, I am new to Unity. This is my first post here.
NB: I have searched extensively (here and in the Forums) before requesting for help.
Comment
Your answer
