I am using SetParent
to host external app in my app (using WindowsFormHost
).
The flow is like that:
- I open my app
- I open the external app
programmaticly
- I use SetParent to host it within my app.
Due to the flow above, when the external app opens, I can see it in the taskbar/task manager for a split second (until the parent is set).
Can I somehow change the order that it will first set the parent and then open the app? all I want is to avoid what I just described..
If you have any other solution for my problem I will gladly accept it.
EDIT:
This is my code
string strPres = @"C:\Users\Ron\Desktop\Create an Office Mix.pptx";
oPPT = new Microsoft.Office.Interop.PowerPoint.Application();
oPPT.Visible = Microsoft.Office.Core.MsoTriState.msoTrue;
objPresSet = oPPT.Presentations;
objPres = objPresSet.Open(strPres, MsoTriState.msoFalse,
MsoTriState.msoFalse, MsoTriState.msoTrue);
objPres.SlideShowSettings.ShowType = Microsoft.Office.Interop.PowerPoint.PpSlideShowType.ppShowTypeWindow;
objPres.SlideShowSettings.Run();
objPres.Windows[1].Close();
objPres.Saved = MsoTriState.msoTrue;
uint oPPTID;
GetWindowThreadProcessId(new IntPtr(oPPT.HWND), out oPPTID);
_process = Process.GetProcessById((int)oPPTID);
_process.WaitForInputIdle();
SetParent(_process.MainWindowHandle, _panel.Handle);