Killing Internet Explorer results in Crash Recovery prompt
I'm currently working on an application that uses an embedded internet explorer browser. The application is written in C# in visual studio 2010. IE is IE9, but the problem also occurs in previous versions of IE.
The application is based on Oracle Customer On Demand, but is a standalone application that uses the embedded browser and adds some extensions to it.
Now the problem is, whenever I close my appl开发者_JS百科ication, and open IE, IE tells me: -Your last browsing session closed unexpectedly. And it wants to reopen the page used in my application.
How can I prevent this? I know I can turn off "enable automatic crash recovery" but I don't think this is a clean solution. Is there a way to close IE from inside Visual studio properly?
At the moment it gets closed by doing:
foreach ( var ieProcessId in this.ieProcessIds )
{
Process.GetProcessById(ieProcessId).Close();
Process.GetProcessById(ieProcessId).Kill();
}
Kill() it's immediate stop (when application can't save own resoults).
Try more gently CloseMainWindow().
精彩评论