I have:
1 Form 1 Panel
I do this with no issue: Run notepad.exe and get it to run inside the panel, no problems. however, running either the 2003 or 2007 viewer I get it to launch but not inside the form. (sample code below)
//DLL Import
using System.Runtime.InteropServices;
[DllImport("user32.dll")]
static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
string ppviewer = @"C:\Program Files\Microsoft Office\Office12\PPTVIEW.EXE";
System.Diagnostics.ProcessStartInfo startinfo = new System.Diagnostics.ProcessStartInfo(ppviewer);
startinfo.Arguments = @"D:\Test.pps /s";
System.Diagnostics.Process pptprocess = System.Diagnostics.Process.Start(startinfo);
pptprocess.WaitForInputIdle();
SetParent(pptprocess.MainWindowHandle, this.panel1.Handle);
I try the same with PPTViewer.exe and I can't get the Powerpoint slide to run inside the form. It launches the viewer, but outside of the form.
Not sure if I have to do something special here.