I am trying to embed PowerPoint Viewer 2007 in my WPF application. I managed to use a Process to start up the viewer with a file specified and put it in my application window with SetParent and such WinAPI commands. But the slideshow in my application window is always chopped off partially because my application window is not full screen and unfortunately PowerPoint Viewer always starts up fullscreen. Any idea how I can resize the slideshow so that it appears nicely in my window?
So far, here is my code.
Process proc = Process.Start(new ProcessStartInfo(){ FileName = "C:\\Program Files\\Microsoft Office\\Office12\\PptView.exe", Arguments="/S" + "\"" + "C:\\Test.ppt" + "\"", WindowStyle=ProcessWindowStyle.Minimized});
System.Threading.Thread.Sleep(1000);
SetParent(proc.MainWindowHandle, myWindowHandle);
SendMessage(proc.MainWindowHandle, WM_SYSCOMMAND, SC_MAXIMIZE, 0);
SetWindowPos(proc.MainWindowHandle, (IntPtr)0, 0, 0, 800, 600, SWP_FRAMECHANGED);
InvalidateRect(myWindowHandle, IntPtr.Zero, false);
Hope someone can help. Thanks a lot...