JCSDynamix Blog

TWebBrowser Forces Internet Explorer 6

If you use a TCPPWebBrowser or TWebBrowser component to embed a browser in your application you will most likely find when you run the application the browser component emulates Internet Explorer 6 behaviour, regardless of whetehr you have IE8 or even IE9 installed.

This is actually by design as Microsoft figured most uses of the embeded component are typically in a corporate environment and developers of those systems at the time would have been expecting IE6 behaviour on the target computer.  Later versions of IE may therefore cause the page to break so Microsoft left it up to the system administrators to control how the component renders on an app by app level.

Solution

A simple registry key needs to be added for each application you want to render in a mode above IE6. 

HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE
     Software
          Microsoft
               Internet Explorer
                    Main
                         FeatureControl
                              FEATURE_BROWSER_EMULATION    (you may have to add this key)

 For each application now add a DWORD entry where the name of the entry is the name of the executable and the DWORD value is one of the following -

Value Description
9999 (0x270F) Internet Explorer 9. Webpages are displayed in IE9 Standards mode, regardless of the !DOCTYPE directive.
9000 (0x2328) Internet Explorer 9. Webpages containing standards-based !DOCTYPE directives are displayed in IE9 mode.
8888 (0x22B8) Webpages are displayed in IE8 Standards mode, regardless of the !DOCTYPE directive.
8000 (0x1F40) Webpages containing standards-based !DOCTYPE directives are displayed in IE8 mode.
7000 (0x1B58) Webpages containing standards-based !DOCTYPE directives are displayed in IE7 Standards mode.

 eg. Suppose your executable was called MyApplication.exe and you wanted it to run in IE8 mode you would add a DWORD decimal value of 8000 like follows -

"MyApplication.exe" = dword 8000 (0x1F40)