473,382 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

handling onscroll event of WebBrowser (repost)

I'll try reposting this message with the hope someone can help me with
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 go
http://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

Aug 18 '06 #1
0 1685

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: viza | last post by:
Hi! I use the onscroll event to make something like the CSS position:fixed; for MSIE. In MSIE/5.5, before a function is assigned to the event handler, it has the value null. In Opera, it is...
1
by: Mark Szlazak | last post by:
Is there a way to detect if an textarea onscroll event is working in Firefox (or Mozilla). I know that there is an onscroll event bubbling bug with current vesions of these browsers so I want to...
2
by: lorinho | last post by:
Alright, I'm stumped. Per this article from Microsoft I should be able to capture the onscroll event for an iframe but for some reason it doesn't seem to be working for me... ...
1
by: Simon Wigzell | last post by:
Firefox has strange behaviour with onscroll. I have a sample page here: http://www.dynamicwebsitesystems.com/ScrollTest.htm If I make this the startup page for the firefox browser or launch it...
0
by: gregtyndall | last post by:
I have a weird problem. I'm using a master page to hold a menu that I want to scroll as the user scrolls in the browser window so it will always be visible. First off, putting onsroll in the body...
0
by: Jocker | last post by:
Hi Group I'm writing an Internet Explorer plugin. Everything works well, except when I try to handle the onscroll event....
2
by: Sam | last post by:
While attempting to get my floating toolbar to work in ASP.NET 2.0, I noticed that the onscroll event is not firing. I've specified this on the BODY tag, as always. After some testing, I...
6
by: AB | last post by:
Hi, I have a listbox and a webbrowser control. For each single item selected I am generating a different web page. However for more than one selection, a common web page gets generated. I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.