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:
public class Native { [DllImport("user32.dll", SetLastError = true)] private static extern uint SetParent(IntPtr hWndChild, IntPtr hWndNewParent); public static void LoadProcessInControl(string _Process, Control _Control) { System.Diagnostics.Process p = System.Diagnostics.Process.Start(_Process); p.WaitForInputIdle(); Native.SetParent(p.MainWindowHandle, _Control.Handle); } }
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?




Reply With Quote