MDI Container + External Application?
Hey.
Is there any way to make the MDI Container hold an external program as a child? Say I want to develop a tool for something (a game editor in particular) and if I want to render it I want to use another program that just renders it inside the MDI Container (as a child)?
Is this possible? Or is the MDI Container limited to forms in its project?
Re: MDI Container + External Application?
hi
Use the SetParent function in the Win32 api
or
System.Windows.Forms.Form.Parent in .NET
http://msdn.microsoft.com/en-us/library/Aa302340
Curt
Re: MDI Container + External Application?
Please, show me an example.
Do the "program" have to have a certain class inherited to be able to be a child in the MDI Container? That is, I can't start any program and contain it within my program.
All those links you sent got me nowhere; I don't know what to look for. The only thing I found was this, which I don't know how to use:
Code:
[DllImport("User32", CharSet = CharSet.Auto, ExactSpelling = true)]
internal static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndParent);
Re: MDI Container + External Application?
An example that doesn't work:
Code:
Process p = new Process();
// just a test app written in C# (do I need to add something to make it "MDI Child"?
p.StartInfo.FileName = Directory.GetCurrentDirectory() + "\\test_app.exe"; p.Start();
SetParent(p.Handle, this.Handle);