bho

Windows 7 does not fire DISPID_BEFORENAVIGATE2 event?

孤街浪徒 提交于 2019-12-08 09:19:39
问题 I have a BHO that is supposed to intercept the DISPID_BEFORENAVIGATE2 events when Windows Explorer is browsing the local disks. It works well in XP and Vista, but stopped working in Windows 7 RC. Turns out, Windows 7 RC stopped sending the DISPID_BEFORENAVIGATE2 events when the local folders are browsed! It does send other events to my BHO (such as DISPID_DOWNLOADBEGIN, etc.), but I need DISPID_BEFORENAVIGATE2. Can anyone confirm this and/or offer a possible workaround? Thanks! 回答1: Well, it

Error adding SCRIPTITEM_CODEONLY symbol using IE9 JS engine (Chakra)

独自空忆成欢 提交于 2019-12-08 07:06:56
问题 We've been using active scripting in our browser extension (BHO) for a while with the old JScript engine (CLSID_JScript), and we recently decided to support the new IE9 script engine (Chakra) as well. One thing we do is add symbols to the engine using AddNamedItem with the SCRIPTITEM_CODEONLY option to create our own modules (namespaces). Unfortunately, we haven't been able to get this to work with Chakra. Even the most trivial example where we add a symbol and immediately retrieve its script

BHO exposing javascript method works in IE 9+ but fails in earlier versions

孤街醉人 提交于 2019-12-08 03:47:39
问题 I'm making a BHO that exposes method to JavaScript. It works okey in IE 9 and IE 10, but fails in IE 8 with RuntimeBinderException : "mshtml.HTMLWindow2Class" does not contain "signJson" . Code is mostly based on live reload IE extention. Here is a way that function is injected into window: public void InjectScriptResource(dynamic window) { var windowEx = (IExpando)window; if (windowEx.GetProperty("signJson", BindingFlags.Default) == null) { windowEx.AddProperty("signJson"); window.signJson =

Handling an OnClick event of a checkbox

时光总嘲笑我的痴心妄想 提交于 2019-12-08 02:22:07
问题 I'm trying to handle click events of a checkbox control from a BHO. Here is my code: void STDMETHODCALLTYPE CMyBHO::OnDocumentComplete(IDispatch *pDisp, VARIANT *pvarURL) { // ... InitPage(pDocument); } void CMyBHO::InitPage(IHTMLDocument2 *pDocument) { CComQIPtr<IHTMLDocument3> document3 = pDocument; CComPtr<IHTMLElement> elementCheckbox; document3->getElementById(CComBSTR(L"checkbox_id_here"), &elementCheckbox); if(!elementCheckbox) return; if(!m_fCheckboxAdvised) { // Register to sink

DocumentComplete is firing before page is fully loaded

感情迁移 提交于 2019-12-08 02:01:37
问题 Why does DocumentComplete event of WebBrowser COM object fire before page is loaded? I thought that this event is only fired when page is fully rendered in browser's window. this is my BHO implementation: [ComVisible(true), Guid("5a954357-44bd-4660-9570-17bb1b71eeaa"), ClassInterface(ClassInterfaceType.None)] public class BHO : IObjectWithSite { private WebBrowser browser; private DateTime startTime; private DateTime endTime; private object _pUnkSite; public void OnDocumentComplete(object

Detect Page Refresh in BHO

吃可爱长大的小学妹 提交于 2019-12-07 17:33:21
问题 IE doesn't fire DocumentComplete & NavigateComplete2 events after a page refresh (F5). This is apparently "by design", but it makes it hard to respond to a page reload. What approaches out there have had the best success? What are the caveats? Thx 回答1: There is no direct method and it is hard to implement across different versions of IE. Although you can use combination of some events to achieve that. Be warned the following approaches are not fool proof. Links: MSDN Forum Detecting the IE

How to start creating a BHO in C#?

梦想与她 提交于 2019-12-07 15:17:26
问题 I need to create a BHO in C#. Any documentation available other than the typical Microsoft C++ example? How do I start? Thanks... 回答1: It's not that difficult really, but you will have to get your hands dirty with COM interop. I just recently did this for a line-of-business application. Basically you gotta implement IObjectWithSite in your add-in and from there you just hook up to the WebBrowser events the same as you would with an embedded WebBrowser control. Here is an example. http://www

Internet Explorer BHO, writing to registry and admin privileges

走远了吗. 提交于 2019-12-07 11:25:45
for some reasons when I try to write to registry when IE doesn't run with admin privileges, Utils::SetValueInRegistry(HKEY_CURRENT_USER,L"Software\\myApp23",L"Domain", value.c_str()); Anyone knows how to gain my BHO rights to write to registry everytime? Or maybe should I write to another section to registry that's available for writing? The information I need to store is very dynamic and used in order to communicate between tabs. Thanks. Internet Explorer is running with Low Integrity Level. Use a key below HKEY_CURRENT_USER\Software\LowRegistry 来源: https://stackoverflow.com/questions

Error adding SCRIPTITEM_CODEONLY symbol using IE9 JS engine (Chakra)

回眸只為那壹抹淺笑 提交于 2019-12-06 17:48:25
We've been using active scripting in our browser extension (BHO) for a while with the old JScript engine (CLSID_JScript), and we recently decided to support the new IE9 script engine (Chakra) as well. One thing we do is add symbols to the engine using AddNamedItem with the SCRIPTITEM_CODEONLY option to create our own modules (namespaces). Unfortunately, we haven't been able to get this to work with Chakra. Even the most trivial example where we add a symbol and immediately retrieve its script dispatch yields an E_OUTOFMEMORY error. if (SUCCEEDED(hr)) { hr = scriptEngine->AddNamedItem(L"test",

How to get complete HTML body using browser helper object (BHO) in case of DHTML/AJAX page?

做~自己de王妃 提交于 2019-12-06 15:04:13
问题 I'm writing a BHO that analyze the HTML taken from the 'onDocumentComplete' event of 'DWebBrowserEvents2' . Currently it works fine, unless I have a DHTML/AJAX page, where HTML handle is delivered too soon. For sample, I tried using it on 'http://www.google.com' . From the 'onDocumentComplete' event I can get most of the page but in the topmost link/anchors, the 'href' for maps, videos, orkut etc. is not available (normally it is javascript:void(0) ). Has anyone any ideas how to capture it