this issue.
PS: is this the right newsgroup for this question?
---
Hi Group
I'm writing an Internet Explorer plugin. Everything works well, except
when I try to handle the onscroll event.
>From MSDN it seems that IHTMLWindow2.onscroll property is the way to gohttp://msdn.microsoft.com/workshop/b...ence/ifaces/wi...
http://msdn.microsoft.com/workshop/a...ce/events/onsc...
another possibility seems to exist with IHTMLElement2.onscroll using
the document body, but this does not solve the problem.
the following code snippet compiles but when executed it always throws
a System.NotImplementedException
this is the stack trace:
in mshtml.HTMLWindow2Class.IHTMLWindow2_set_onscroll( Object p)
this is the code:
-------
//WebBrowser is a valid instance of SHDocVw.WebBrowserClass
this.WebBrowser.DocumentComplete += new
DWebBrowserEvents2_DocumentCompleteEventHandler(we bBrowser_DocumentComplete);
void webBrowser_DocumentComplete(object pDisp, ref object URL)
{
mshtml.IHTMLDocument2 document =
(mshtml.IHTMLDocument2)this.WebBrowser.Document;
mshtml.IHTMLWindow2 window = document.parentWindow;
try
{
//window.onscroll =
// new mshtml.HTMLWindowEvents_onscrollEventHandler(
// this.webBrowserWindow_onscroll);
window.onscroll =
new mshtml.HTMLWindowEvents2_onscrollEventHandler(
this.webBrowserWindow_onscroll);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
private void webBrowserWindow_onscroll()
{
MessageBox.Show("scroll");
}
private void webBrowserWindow_onscroll(mshtml.IHTMLEventObj pEvtObj)
{
MessageBox.Show("scroll2");
}
------
any idea on what I'm doing wrong?
thanks
Claudio