Whose Bug Is This - IE or Windows/.NET?
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?
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.
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.
精彩评论