Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SHDocVw.WebBrowser versioning..
#1
Hi -

I'm on a machine with IE11 but when I create a dialog with a web control (SHDocVw.WebBrowser) and I run JavaScript inside of it - the user agent string says that it's running IE7. Is there any way to run a more recent version of IE in a WebBrowser control? Or should I be invoking SHDocVw.InternetExplorer?

Thanks

Sean
#2
From
http://www.pedautreppe.com/post/How-can ... trol-.aspx

Quote:the WebBrowser control is run in "IE7 compatibility mode", and so, quite logically, CSS3 is not supported.
How to correct it ?

Another important thing to know is that the WebBrowser control can be intensively configured thru the registry. That's what we call the Internet Feature Controls. More info about all those features can be found on http://msdn.microsoft.com/en-us/library ... 20(v=VS.85).aspx

And one of these features is called Browser Emulation. It is the feature that controls the compatibility mode used by the WebBrowser control when rendering a page. The possible values are :

7000 : IE7 Standard mode (default)
8000 : IE8 mode if containing standards-based DOCTYPE
8888 : IE8 mode, whatever the DOCTYPE
9000 : IE9 mode if containing standards-based DOCTYPE
9999 : IE9, whatever the DOCTYPE

All info can be found on http://msdn.microsoft.com/en-us/library ... _emulation

So what do you need to do ? Just add a new DWORD value in the following registrey key:

HKEY_LOCAL_MACHINE
SOFTWARE
Microsoft
Internet Explorer
MAIN
FeatureControl
FEATURE_BROWSER_EMULATION

The key you need to add is the name of your executable, meaning, if your application is named "WindowsFormsApplication1"

WindowsFormsApplication1.exe
#3
Thanks!

I had to make one additional change - I had to add a qm.exe (will change that when I make an *.exe) with a value here as well:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION

Works very well. Thanks again!
#4
Function WebBrowserControlDisableIE7Emulation
http://www.quickmacros.com/forum/showthr...p?tid=6437
#5
seandoyle Wrote:Thanks!

I had to make one additional change - I had to add a qm.exe (will change that when I make an *.exe) with a value here as well:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION

Works very well. Thanks again!
64-bit regedit displays the key as HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Internet Explorer\...
QM and other 32-bit programs see this key as HKEY_LOCAL_MACHINE\SOFTWARE\Internet Explorer\...


Forum Jump:


Users browsing this thread: 1 Guest(s)