Disable navigation sounds in wxWebViewIE. This brings the backend into line with the other backends. Also add a general method for changing INTERNETFEATURELIST settings.
See #13694 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70499 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
d9c4ffa893
commit
9447a0d6af
@ -384,6 +384,8 @@ private:
|
|||||||
bool CanExecCommand(wxString command) const;
|
bool CanExecCommand(wxString command) const;
|
||||||
void ExecCommand(wxString command);
|
void ExecCommand(wxString command);
|
||||||
IHTMLDocument2* GetDocument() const;
|
IHTMLDocument2* GetDocument() const;
|
||||||
|
//Toggles control features see INTERNETFEATURELIST for values.
|
||||||
|
bool EnableControlFeature(long flag, bool enable = true);
|
||||||
|
|
||||||
wxDECLARE_DYNAMIC_CLASS(wxWebViewIE);
|
wxDECLARE_DYNAMIC_CLASS(wxWebViewIE);
|
||||||
};
|
};
|
||||||
|
@ -87,6 +87,8 @@ bool wxWebViewIE::Create(wxWindow* parent,
|
|||||||
|
|
||||||
m_container = new wxIEContainer(this, IID_IWebBrowser2, m_webBrowser, m_uiHandler);
|
m_container = new wxIEContainer(this, IID_IWebBrowser2, m_webBrowser, m_uiHandler);
|
||||||
|
|
||||||
|
EnableControlFeature(21 /* FEATURE_DISABLE_NAVIGATION_SOUNDS */);
|
||||||
|
|
||||||
LoadURL(url);
|
LoadURL(url);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -790,6 +792,44 @@ IHTMLDocument2* wxWebViewIE::GetDocument() const
|
|||||||
return document;
|
return document;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool wxWebViewIE::EnableControlFeature(long flag, bool enable)
|
||||||
|
{
|
||||||
|
#if wxUSE_DYNLIB_CLASS
|
||||||
|
|
||||||
|
wxDynamicLibrary urlMon(wxT("urlmon.dll"));
|
||||||
|
if( urlMon.IsLoaded() &&
|
||||||
|
urlMon.HasSymbol("CoInternetSetFeatureEnabled") &&
|
||||||
|
urlMon.HasSymbol("CoInternetIsFeatureEnabled"))
|
||||||
|
{
|
||||||
|
typedef HRESULT (WINAPI *CoInternetSetFeatureEnabled_t)(DWORD, DWORD, BOOL);
|
||||||
|
typedef HRESULT (WINAPI *CoInternetIsFeatureEnabled_t)(DWORD, DWORD);
|
||||||
|
|
||||||
|
wxDYNLIB_FUNCTION(CoInternetSetFeatureEnabled_t, CoInternetSetFeatureEnabled, urlMon);
|
||||||
|
wxDYNLIB_FUNCTION(CoInternetIsFeatureEnabled_t, CoInternetIsFeatureEnabled, urlMon);
|
||||||
|
|
||||||
|
HRESULT hr = (*pfnCoInternetIsFeatureEnabled)(flag,
|
||||||
|
0x2 /* SET_FEATURE_ON_PROCESS */);
|
||||||
|
if((hr == S_OK && enable) || (hr == S_FALSE && !enable))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
hr = (*pfnCoInternetSetFeatureEnabled)(flag,
|
||||||
|
0x2/* SET_FEATURE_ON_PROCESS */,
|
||||||
|
(enable ? TRUE : FALSE));
|
||||||
|
if ( FAILED(hr) )
|
||||||
|
{
|
||||||
|
wxLogApiError(wxT("CoInternetSetFeatureEnabled"), hr);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
#else
|
||||||
|
wxUnusedVar(flag);
|
||||||
|
wxUnusedVar(enable);
|
||||||
|
return false;
|
||||||
|
#endif // wxUSE_DYNLIB_CLASS/!wxUSE_DYNLIB_CLASS
|
||||||
|
}
|
||||||
|
|
||||||
void wxWebViewIE::onActiveXEvent(wxActiveXEvent& evt)
|
void wxWebViewIE::onActiveXEvent(wxActiveXEvent& evt)
|
||||||
{
|
{
|
||||||
if (m_webBrowser == NULL) return;
|
if (m_webBrowser == NULL) return;
|
||||||
|
Loading…
Reference in New Issue
Block a user