WPF WebBrowser Browser Version

前端 未结 2 1748
粉色の甜心
粉色の甜心 2021-01-05 05:38

Does the WPF WebBrowser control depend on the version of IE that is installed on the user\'s machine, or does it use a separate library that is consistent across machines?

2条回答
  •  無奈伤痛
    2021-01-05 06:37

    The MSDN remarks for WebBrowser indicate it rehosts the IE ActiveX control:

    The WebBrowser control internally instantiates the native WebBrowser ActiveX control.

    The WebBrowser ActiveX control is better known as Shdocvw.dll. This in turn wraps Mshtml.dll, and probably other DLL's given your environment. One caveat of rehosting this control is its setting for Browser Emulation:

    For applications hosting the WebBrowser Control, the default value is 7000. To control the value of this feature by using the registry, add the name of your executable file to the following setting and set the value to match the desired setting.

    0x7000 means IE7 compatibility mode. Therefore, if you would like your WPF application to render using some other mode you need to update the registry, as adapted from this example:

    [HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION] 
    "MyApplication.exe" = dword:2328
    

提交回复
热议问题