-1

I have a web page into my local PC and I need to show it into a TWebBrowser. It shows a heatmap like this.

When I show this page into IE, it is well displayed (it shows the heatmap), but when I load it into a TWebBrowser, it only display the map, not the heatmap. Why? Any solution?

Thanks

cadetill
  • 1,552
  • 16
  • 24
  • `TWebBrowser` is just a wrapper for Internet Explorer, so it should be behaving the same way that the full browser does. – Remy Lebeau Jun 11 '14 at 00:30
  • Did you configure the machine to use modern browser in the control, or are you stuck with legacy browser – David Heffernan Jun 11 '14 at 04:29
  • @RemyLebeau I know it, for this I don't understand why not work – cadetill Jun 11 '14 at 06:04
  • @DavidHeffernan I use the default TWebBrowser – cadetill Jun 11 '14 at 06:04
  • 1
    No. I mean the registry setting and doctype opt in that allows modern IE in TWebBrowser. Without this you get IE6 or some such. – David Heffernan Jun 11 '14 at 06:07
  • 1
    @cadetill, David is hinting at the [Browser Emulation feature](http://msdn.microsoft.com/en-us/library/ee330730%28VS.85%29.aspx#browser_emulation). See this [SO question](http://stackoverflow.com/questions/6534614/twebbrowser-and-feature-browser-emulation-at-runtime) for more info... – whosrdaddy Jun 11 '14 at 06:28
  • thanks a lot, work perfectly now :) – cadetill Jun 11 '14 at 18:20

1 Answers1

1

TWebBrowser is a wrapper of hosted WebBrowser Control. If your system has a MSIE 5-7 installed, your browser application renders web pages exactly the same as MSIE. I can imagine the heatmap looks broken in old MSIE, too.

If your system has a MSIE 8 (or higher) installed, your browser application will render web pages by default in compatible mode, unless you specify the default emulation mode explicitly in Registry.

The Solution

For instance, your system has MSIE 10 installed and your application is yourapp.exe. You'd write a string entry name=yourapp.exe, value=10000 into Registry. I recommend write to HKCU for the current user (not HKLM).

HKEY_LOCAL_MACHINE (or HKEY_CURRENT_USER)
   SOFTWARE
      Microsoft
         Internet Explorer
            Main
               FeatureControl
                  FEATURE_BROWSER_EMULATION
                     yourapp.exe = (DWORD) 00010000 

Now your application can render the heatmap exactly as MSIE10 does. A full list of emulation values is described at (MSDN).

Note that you should first read the version of MSIE installed on your system. You cannot set emulation mode to 11000 (MSIE11), if you have only MSIE10 installed.

stanleyxu2005
  • 8,081
  • 14
  • 59
  • 94