I am opening a web page using a WebBrowserComponent, and that webpage has a button with onclick=“window.close();”
Upon clicking on the button, I receive this messagebox:
After clicking yes, the WebBrowserComponent is no longer being drawn (paint() does nothing) and all I see in it’s place is a black void.
Is there any way of detecting this? I read the IWebBrowser2 API and it seems there’s this event called DWebBrowserEvents2::OnQuit(), but I have no experience in Win32API/ActiveX…
// 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
{
unsigned int val = *(unsigned int*)data.getData();
if (val >= correctValue)
ok = true;
}
}
if (!ok)
{
WindowsRegistry::setValue(key, correctValue);
}