0

C#. Can I say to the webbrowser in my winform application - use only IE7 (IE8-IE11, Edge) version regardless of the property FEATURE_BROWSER_EMULATION value in the registry?

I try to find any information about this, but find only manipulation with FEATURE_BROWSER_EMULATION value in the registry.

I think, that I must to use this function:

[DllImport("wininet.dll", SetLastError = true)]

private static extern bool InternetSetOption( IntPtr hInternet, int dwOption, IntPtr lpBuffer, int lpdwBufferLength);

but don't find any info.

Thanks!

RYurik
  • 1
  • 1
  • [Use latest version of Internet Explorer in the webbrowser control](https://stackoverflow.com/a/25650219/14171304) – dr.null Mar 01 '21 at 15:29
  • I think you can only use FEATURE_BROWSER_EMULATION to define which version of IE to use in webbrowser. About how to use it, you can refer to the link in the first comment. I don't know why you use [InternetSetOption function](https://learn.microsoft.com/en-us/windows/win32/api/wininet/nf-wininet-internetsetoptiona), it just sets an Internet option and I think it can't achieve what you want. – Yu Zhou Mar 02 '21 at 05:55
  • What is the problem with `FEATURE_BROWSER_EMULATION`? Note that `InternetSetOption()` just changes Registry settings. -- @dr.null That's not the right answer (despite the *votes*), for more than one reason. These are the good ones: [How can I get the WebBrowser control to show modern contents?](https://stackoverflow.com/a/38514446/7444103) and [Web browser control emulation issue (FEATURE_BROWSER_EMULATION)](https://stackoverflow.com/a/28626667/7444103) – Jimi Mar 02 '21 at 05:57
  • @dr.null That's not a matter of *perfection*. That answer is trying to modify the `HKEY_LOCAL_MACHINE` branch. This requires the app to run elevated, thus to request user permission (which may not be granted or not even available). Adding the application executable name to the `HKEY_CURRENT_USER` branch has the same result and doesn't require elevation. Other parts are related to old Registry values and don't apply anymore or are useless (also useless is directly addressing the `Wow6432Node` branch). You'll find something else if you look closer. – Jimi Mar 02 '21 at 10:32

0 Answers0