CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    26

    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?

  2. #2
    Join Date
    May 2002
    Location
    Boston
    Posts
    67

    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

  3. #3
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    26

    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);

  4. #4
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    26

    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);

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured