firstly, is there any way to specify which browser to use. it seems it always runs an IE image.
Given that you have to have an IE browser here, there’s a nasty problem waiting to bite. Using the `WebBrowserComponent’ i get a truckload of errors; script errors, security failure. etc etc. Turns out that IID_IWebBrowser2 interface actually runs IE7 for “compatibility” reasons!!
So, how do you get it to run the proper one. turns out you have to add something nasty to your registry in HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION. (dont you just love it!)
Anyhow, here’s a nasty hack i do to correct the registry in my app.
[code]void SomeClass::fixWindowsRegistry()
{
#ifdef JUCE_WINDOWS
// want to add a key of the form
// <binaryname>.exe DWORD 9999
// 9999 indicates IE9
String keypath = "HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\Main\\FeatureControl\\FEATURE_BROWSER_EMULATION\\";
// build the full path to the key
String key = keypath + JUCEApplication::getInstance()->getApplicationName() + ".exe";
// this is the value we want
unsigned int correctValue = 9999;
bool ok = false;
// lets look for it anyway
bool v = WindowsRegistry::valueExists(key);
if (v)
{
MemoryBlock data;
unsigned int sz = WindowsRegistry::getBinaryValue(key, data);
if (sz == 4) // DWORD
{
int val = *(unsigned int*)data.getData();
if (val == correctValue)
ok = true;
}
}
if (!ok)
{
WindowsRegistry::setValue(key, correctValue);
}
#endif
}[/code]
if anyone has a better idea, i’d wecome it!
– hugh.