Note that there are some explanatory texts on larger screens.

plurals
  1. POBHO IE 9 Capture OnScroll Event if a site has the meta tag content="IE=9"
    primarykey
    data
    text
    <p>I recently noticed that I'm unable to capture the OnSroll events of the "top" window in my BHO if I'm showing a page in IE9 and the page contais the tag: <code>&lt;meta http-equiv="X-UA-Compatible" content="IE=9"&gt;.</code></p> <p>I capture the scroll by sinking the DISPID_HTMLWINDOWEVENTS2_ONSCROLL of DIID_HTMLWindowEvents2 in the IHTMLWindow2 of the Top Document, and it works fine in all cases, except if the page contains that meta tag.</p> <p>My sink class is defined as:</p> <pre><code>class CIEPage : public IDispEventImpl&lt;1, CIEPage, &amp;DIID_HTMLDocumentEvents2, &amp;LIBID_MSHTML, 4, 0&gt;, public IDispEventImpl&lt;2, CIEPage, &amp;DIID_HTMLWindowEvents2, &amp;LIBID_MSHTML, 4, 0&gt; // SinkMap BEGIN_SINK_MAP(CIEPage) SINK_ENTRY_EX(1, DIID_HTMLDocumentEvents2, DISPID_HTMLELEMENTEVENTS2_ONMOUSEOVER, OnMouseOver) SINK_ENTRY_EX(2, DIID_HTMLWindowEvents2, DISPID_HTMLWINDOWEVENTS2_ONSCROLL, OnScroll) END_SINK_MAP() </code></pre> <p>And i'm sinking like this.</p> <pre><code>hr = IDispEventImpl&lt;1, CIEPage, &amp;DIID_HTMLDocumentEvents2, &amp;LIBID_MSHTML, 4, 0&gt;::DispEventAdvise(_spDocument); if(SUCCEEDED(hr)) _bAdvised[ListenerEventMouseOver] = true; if(IsTopPage()) { hr = _spDocument-&gt;get_parentWindow(reinterpret_cast&lt;IHTMLWindow2 **&gt;(&amp;_spWindow)); if (SUCCEEDED(hr) &amp;&amp; _spWindow) { hr = IDispEventImpl&lt;2, CIEPage, &amp;DIID_HTMLWindowEvents2, &amp;LIBID_MSHTML, 4, 0&gt;::DispEventAdvise(_spWindow); if(SUCCEEDED(hr)) _bAdvised[ListenerEventScroll] = true; } } </code></pre> <p>where _spDocument is a <code>CComPtr&lt;IHTMLDocument2&gt;</code> and _spWindow a <code>CComPtr&lt;IHTMLWindow2&gt;</code></p> <p>Any ideias? Also it seems to exist a mismatch in IE9 SDK headers and the documentation of msdn. For example the new document events of IE 9 in the <a href="http://msdn.microsoft.com/en-us/library/ff976251%28v=VS.85%29.aspx">documents</a> define many events that aren't available in the SDK. This is the definition in the mshtml.idl</p> <pre><code>[ hidden, uuid(30510737-98b5-11cf-bb82-00aa00bdce0b) ] dispinterface HTMLDocumentEvents4 { properties: methods: [id(DISPID_HTMLDOCUMENTEVENTS4_ONMSTHUMBNAILCLICK)] void onmsthumbnailclick([in] IHTMLEventObj* pEvtObj); [id(DISPID_HTMLDOCUMENTEVENTS4_ONMSSITEMODEJUMPLISTITEMREMOVED)] void onmssitemodejumplistitemremoved([in] IHTMLEventObj* pEvtObj); }; </code></pre> <p>Since, there is now according to the msdn a OnScrollEvent on a document, maybe it's that event that I need to sink if the browser is version 9 and the page contais the IE=9... but the SDK doesn't contain that information...</p> <p>Any help is appreciated. Thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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