views:

62

answers:

2

When I run this and then go into the task manager and manually end one of the iexplore instances (there are 2 presumably since IE now also uses multiple processes) I see an error pop-up box that says a tab has been recovered. However, iexplore itself is invisible because of my process settings. Accordingly, I don't think that that pop-up balloon recovery message should show up. Is this the fault of IE not checking whether or not it is visible before showing this message or is this the fault of Windows/.NET not blocking IE from showing any 'windows' (balloons in this case)?

Process process = new Process
{
  StartInfo =
  {
     CreateNoWindow = false,
     FileName = "iexplore.exe",
     UseShellExecute = true,
     ErrorDialog = false,
     WindowStyle = ProcessWindowStyle.Hidden
  }
};

process.Start();

If this is a bug, where in the world do I report it? Connect?

+1  A: 

I'm surprised this works at all, non-console mode apps routinely ignore the requested WindowStyle. Try notepad.exe for example.

But yes, this would be a flaw in IE. The Process class has otherwise no powers beyond just passing the requested window style to the started process. The process gets this request through the nShowCmd() argument of WinMain().

There is a feedback channel for IE at Connect. But they will only accept reports for IE9 and you have to apply. Trying to duck IE6 hate mail, I'd guess.

Hans Passant
Hmm, so you're saying that it's the app's choice to ignore these settings? I could understand that more with the WindowStyle setting. However, the CreateNoWindow option sounds more like something Windows controls (aka - the app is unaware it's hidden).I will take a look at registering on Connect...I assume this bug exists in IE9 as well.On a side note, notepad.exe does get hidden.
Chad
Yes, this is IE's fault, not the runtime's. However as far as bugs go, I suspect this is fairly low priority... it's not really a supported scenario and there is a way to correctly do what you want (see my answer).
jeffamaphone
+1  A: 

If you want to do this the correct way, you should write the interop to CoCreateInstance() CLSID_InternetExplorer with IID_IWebBrowser2. You can get the interop for IWebBrowser2 at pinvoke.net.

This will create an invisible IE instance, then you can use IWebBrowser2::put_Visible(VARIANT_TRUE) to make it visible later.

jeffamaphone
This scares me that you know this much :-) Thanks for the information, it looks like just what I need, though it will be a bit more work.
Chad
I have unique experience.
jeffamaphone