Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>A long time ago I have found solution for the same problem, but it was just one-time experiment with BHO, so today it's hardly to remember what to do. But I can give you this piece of code as a starting point to further searching.</p> <pre><code>void CEventSink::Event_NavigateComplete(IDispatch *pDisp, LPOLESTR url) { HRESULT hr; IDispatch *pTmpDisp; IWebBrowser2 *pFrame; hr = pDisp-&gt;QueryInterface(IID_IWebBrowser2, (void **)&amp;pFrame); if (FAILED(hr) || !pFrame) return; hr = pFrame-&gt;get_Document(&amp;pTmpDisp); if (FAILED(hr) || !pTmpDisp) return; IHTMLDocument2 *pDocument; hr = pTmpDisp-&gt;QueryInterface(IID_IHTMLDocument2, (void **)&amp;pDocument); if (FAILED(hr) || !pDocument) return; IHTMLWindow2 *pWindow; pDocument-&gt;get_parentWindow(&amp;pWindow); if (FAILED(hr) || !pWindow) return; IDispatchEx *pDispEx; hr = pWindow-&gt;QueryInterface(IID_IDispatchEx, (void **)&amp;pDispEx); if (FAILED(hr) || !pDispEx) return; DISPID dispId; BSTR name = SysAllocString(_T("someMethod")); pDispEx-&gt;GetDispID(name, fdexNameEnsure, &amp;dispId); SysFreeString(name); if (FAILED(hr) || dispId == DISPID_UNKNOWN) return; hr = this-&gt;QueryInterface(IID_IDispatch, (void **)&amp;pTmpDisp); if (FAILED(hr) || !pTmpDisp) return; VARIANT v; VariantInit(&amp;v); v.vt = VT_DISPATCH; v.pdispVal = pTmpDisp; DISPID ppid = DISPID_PROPERTYPUT; DISPPARAMS p; p.rgvarg = &amp;v; p.cArgs = 1; p.rgdispidNamedArgs = &amp;ppid; p.cNamedArgs = 1; hr = pDispEx-&gt;InvokeEx(dispId, LOCALE_USER_DEFAULT, DISPATCH_PROPERTYPUT, &amp;p, NULL, NULL, NULL); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload