T
timnels
I have been able to execute Notepad.exe in a Panel (set to Dock.Fill)
on a Windows Form, like:
ProcessStartInfo psi = new ProcessStartInfo("notepad");
p = Process.Start(psi);
p.WaitForInputIdle();
SetParent(p.MainWindowHandle, uiAppPanel.Handle);
ShowWindow(p.MainWindowHandle, (int)ShowCommands.SW_MAXIMIZE);
int style = GetWindowLong(p.MainWindowHandle, GWL_STYLE);
SetWindowLong(p.MainWindowHandle, GWL_STYLE, style & ~WS_CAPTION);
Only problem now when I resize the Form the Panel resizes, but I need a
way to tell Notepad to resize to fill the panel (maximize I guess)
also. I tried calling ShowWindow again, but that seems to have no
effect. Is it possible to make this work?
on a Windows Form, like:
ProcessStartInfo psi = new ProcessStartInfo("notepad");
p = Process.Start(psi);
p.WaitForInputIdle();
SetParent(p.MainWindowHandle, uiAppPanel.Handle);
ShowWindow(p.MainWindowHandle, (int)ShowCommands.SW_MAXIMIZE);
int style = GetWindowLong(p.MainWindowHandle, GWL_STYLE);
SetWindowLong(p.MainWindowHandle, GWL_STYLE, style & ~WS_CAPTION);
Only problem now when I resize the Form the Panel resizes, but I need a
way to tell Notepad to resize to fill the panel (maximize I guess)
also. I tried calling ShowWindow again, but that seems to have no
effect. Is it possible to make this work?