I am working on a project which requires a flash project to be displayed in an Internet Explorer kiosk mode window. Additionally, using a socket, Flash communicates to my C# application for various tasks Flash cannot perform itself. One of these task is opening a PDF and bringing it to the foreground. Flash can not open the PDF directly due to flash security forcing the choice of Network or Local mode and Network is the only choice this project.
The problem I am having is on Windows XP using IE 8, kiosk mode seems to conflict with Shell32 commands to minimize Internet Explorer and/or bring the PDF to the foreground. I have managed to get this working in Windows 7 (unable to test Vista) but nothing I try seems to work consistently in Windows XP.
I launch the window using the C# processes as such:
explorerProcess = new Process();
explorerProcess.StartInfo = new ProcessStartInfo("IEXPLORE.EXE", "-k file:\\\\" + path);
explorerProcess.Start();
Explorer is now open and in kiosk mode. Next I open the PDF.
pdfProcess = new Process();
pdfProcess.StartInfo = new ProcessStartInfo(fileName);
pdfProcess.Start();
Finally, using the Shell32.dll command ShowWindow I call maximize on the PDF forcing the users attention to it.
ShowWindow(pdfProcess.Handle, SW_MAXIMIZE);
In Windows 7 I now have a PDF maximized and the kiosk mode Internet Explorer window is behind the PDF. This way when the PDF is closed the user is brought back to the kiosk mode window. In Windows XP, the PDF is opened in the background and no amount of ShowWindow calls seems to bring it to the front over the Explorer instance. I have tried minimizing the explorer instance and I have tried performing other windows events like show/hide/restore on IE and on the PDF to try and coax XP into what I want with no success. I am not sure if this is really the fault of XP or if its the fault of Windows 7 (for me) having IE9 vs IE8 on XP.
Anyone else run into this or know of a work around to trick XP into bringing the PDF to the foreground?