Showing a hidden process in Windows?
I have a problem.
Due to my earlier questions about SP3 versus the patched SP3, we have concluded that an Internet Explorer process has started, tasked with downloading a simple .html file from the local drive that contains javascript that opens the rest of the larger chat / meeting system. Internet Explorer is launched from the Lotus Notes client.
Unfortunately, all we see is the IExplore.exe process that appears in the task manager and disappears again after a few seconds.
If we try to open a local .html file that we found on disk, it gives us an information bar at the top, telling us that it has disabled active content. This, however, is not a real problem. We have another machine that has the same settings, but where everything works, and loading the .html file manually also gives us the same error.
However, perhaps another error message appears when IExplore is launched from notes, but since this process should just start the rest of the system and this window is hidden, we cannot see this, that is, the error / problem message.
So, I thought, maybe I should try to create a small program waiting for IExplore.exe to run and then immediately display this window so we can see the error message or any problem. At least I hope we can see it.
So far so good, unless I start a process from my own program with a hidden window, the main window handle is 0 and so I can't show the window in the end. I expect this IExplore.exe process launched from Lotus Notes to have the same issue.
My monitoring program is written in C # and basically starts this loop:
foreach (var process in Process.GetProcesses())
{
if (process.ProcessName.ToLower() == "iexplore")
result.Add(process);
}
This picks up all IExplore.exe processes, windows or not, and with IE8, I get 2 processes for the first window, as expected. I run this over and over and handle the differences from previous runs.
However, initially the process has a window handle of 0, so I changed it to this:
foreach (var process in Process.GetProcesses())
{
if (process.ProcessName.ToLower() == "iexplore" &&
process.MainWindowHandle != IntPtr.Zero)
{
result.Add(process);
}
}
but now it doesn't pick up anything, even after the window has gotten a handle (and yes, process.MainWindowHandle has a nonzero handle value after the window has been shown, but in the case where the window is never displayed, it stays at 0.)
So the question is, is there a way for this hidden IExplore.exe process and instruct it to show itself when it no longer has a window handle? I doubt it, but maybe someone can prove to me what is wrong.
If not, then my backup plan is to create a shim IExplore.exe program that forwards all command line arguments back to the original except that it specifies that a window should be shown. Will this be the solution?
a source to share
I don't believe there is any way to force an IE window that does not have a window handle to position the window handle for itself (or use a previously allocated one) and display itself.
As for your backup method: I think it will work, but you are working in dangerous territory. I would recommend writing your shim to just log every iexplore.exe call and everything that goes into it, and use that to characterize your problem; only after thoroughly characterizing your completely benign logging problem, I suggest perhaps changing the options to force iexplore.exe to display the window.
a source to share