I wanted to open a exe as a tabs in program that im creating.

so far i haven't had much luck.

the code ive been trying to use is

c# Code:
  1. public class Native
  2.         {
  3.             [DllImport("user32.dll", SetLastError = true)]
  4.             private static extern uint SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
  5.             public static void LoadProcessInControl(string _Process, Control _Control)
  6.             {
  7.                 System.Diagnostics.Process p = System.Diagnostics.Process.Start(_Process);
  8.                 p.WaitForInputIdle();
  9.                 Native.SetParent(p.MainWindowHandle, _Control.Handle);
  10.             }
  11.         }

but even though it runs with out error i don't get anything when i run the method like so.


Code:
Native.LoadProcessInControl(@"D:\WINDOWS\notepad.exe", this.splitContainer1.Panel2);

any ideas if im barking up the right tree or why this code might not be working?