Webkit.net, cefsharp,openwebkit.net, etc. these Google-based or Firfox-based browsers have a common denominator, that is, the WinForm must be designated for x86 to use,
And the use of the process is also a variety of pits need to fill.
WebBrowser Bad Place is the default use IE5 kernel to load Web pages, have to spit slot Microsoft is really wonderful, ie has exited the history stage, but WinForm inside the WebBrowser control use or IE core,
The project has a requirement is that the WinForm program, must be x64, x86 often memory overflow, so, those based on the Google kernel has been pass off.
WinForm nested in the site before are based on the Google kernel to develop, in IE11 although there are some minor flaws, but after all, can be used,
So consider how to get WinForm x64 to call the IE11 kernel.
The code is as follows:
RegistryKey key = Registry.LocalMachine.OpenSubKey (@ "Software\Microsoft\Internet explorer\main\featurecontrol\ Feature_browser_emulation ", true);
if (key! = null)
{
Key. SetValue ("XXX.exe", 11001, Registryvaluekind.dword);
Key. SetValue ("XXX.vshost.exe", 11001, Registryvaluekind.dword);//debug run need to add, otherwise does not work
}
Key = Registry.LocalMachine.OpenSubKey (@ "Software\wow6432node\microsoft\internet explorer\main\featurecontrol\ Feature_browser_emulation ", true);
if (key! = null)
{
Key. SetValue ("XXX.exe", 11001, Registryvaluekind.dword);
Key. SetValue ("XXX.vshost.exe", 11001, Registryvaluekind.dword);//debug run need to add, otherwise does not work
}
The values for each version of IE are as follows:
11001 (0X2EDF) Internet Explorer 11. Webpages is displayed in IE11 standards mode, regardless of the! DOCTYPE directive
11000 (0X2AF8): Internet Explorer 11. Webpages containing standards-based! DOCTYPE directives is displayed in IE9 mode
10000 (0x2710): Internet Explorer 10. Webpages containing standards-based! DOCTYPE directives is displayed in IE9 mode.
10001 (0X2AF7): Internet Explorer 10. Webpages is displayed in IE10 standards mode, regardless of the! DOCTYPE directive.
9999 (0x270f): Internet Explorer 9. Webpages is displayed in IE9 standards mode, regardless of the! DOCTYPE directive.
9000 (0x2328): Internet Explorer 9. Webpages containing standards-based! DOCTYPE directives is displayed in IE9 mode.
8888 (0X22B8): Webpages is displayed in IE8 standards mode, regardless of the! DOCTYPE directive.
8000 (0X1F40): webpages containing standards-based! DOCTYPE directives is displayed in IE8 mode.
7000 (0x1b58): webpages containing standards-based! DOCTYPE directives is displayed in IE7 standards mode.
WinForm WebBrowser How to force the use of the IE11 kernel?