1

I'm trying to get a MFC/C++ application on Win8.1/IE11 with an embedded browser window to render in edge (most recent standards) mode. The content for the window is served locally (i.e. not from a web site).

Using <!DOCTYPE html> and <meta http-equiv="X-UA-Compatible" content="IE=edge"> (first thing) in the head gets me IE8 rendering (it's IE5 with neither, IE7 with just DOCTYPE).

I'm aware of the registry setting HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer for adding your own process name to Main\FeatureControl\FEATURE_BROWSER_EMULATION... this in fact works and it renders in IE11 with one major problem: the application happens to be named identically to a Microsoft application which breaks when I set that feature! It seems that the registry setting feature doesn't allow for a full path name to a process either. I know, rename the process... but I can't easily do that for a variety of historical reasons. So...

I have extended the handler class MyDocHandler : public IDocHostUIHandler2, public IOleClientSite {...} and use it via pOleObject->SetClientSite( pMyDocHandler ); before any navigation happens. I implemented IDocHostUIHandler2::GetOverrideKeyPath which is called as expected and I return my own application key path (nearly identical to Microsoft's, i.e. Software\MyCompany\Internet Explorer instead (also tried just Software\MyCompany). I've put the registry setting in place under that path, e.g. my Software\MyCompany\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION\MyProcess.exe but it seems to be ignoring it. I've tried a few different registry path options as well but I'm out of ideas. Oh, I also tried without success using GetOptionKeyPath.

Additionally I've gone so far as trying the HookRegOpenKeyExW hack suggested in another question but there are now apparently several additional stub library compatibility layers making that even more unwieldy.

Anyone got some insight? Thanks

Community
  • 1
  • 1
mark
  • 5,269
  • 2
  • 21
  • 34

1 Answers1

1

Additionally I've gone so far as trying the HookRegOpenKeyExW hack suggested in another question but there are now apparently several additional stub library compatibility layers making that even more unwieldy.

As an alternative, you may want to try RegOverridePredefKey as described here.

Community
  • 1
  • 1
noseratio
  • 59,932
  • 34
  • 208
  • 486
  • 1
    Thanks for the answer. Too bad there isn't a `RegOverride**Specific**Key` version of that API instead of an entire predefined root key. I tried it out, it does seem to work, but I'm concerned about a few things... one concern is overriding some other behaviors of IE like download location, custom security settings, etc. IE dumps down a whole set of default registry items into my redirected location. Another concern is other registry interactions now being redirected (e.g. startup settings, other COM components, etc.). Would hate to have to try to keep entire CURRENT_USER key tree up to date. – mark Aug 22 '14 at 12:37
  • 1
    @mark, if you first make a deep copy of the original key to the redirected location, I think you're going to be all right. – noseratio Aug 24 '14 at 02:54