473,659 Members | 2,662 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.on scroll 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.o nscroll using
the document body, but this does not solve the problem.

the following code snippet compiles but when executed it always throws
a System.NotImple mentedException
this is the stack trace:
in mshtml.HTMLWind ow2Class.IHTMLW indow2_set_onsc roll(Object p)

this is the code:
-------
//WebBrowser is a valid instance of SHDocVw.WebBrow serClass
this.WebBrowser .DocumentComple te += new
DWebBrowserEven ts2_DocumentCom pleteEventHandl er(webBrowser_D ocumentComplete );

void webBrowser_Docu mentComplete(ob ject pDisp, ref object URL)
{
mshtml.IHTMLDoc ument2 document =
(mshtml.IHTMLDo cument2)this.We bBrowser.Docume nt;
mshtml.IHTMLWin dow2 window = document.parent Window;

try
{
//window.onscroll =
// new mshtml.HTMLWind owEvents_onscro llEventHandler(
// this.webBrowser Window_onscroll );
window.onscroll =
new mshtml.HTMLWind owEvents2_onscr ollEventHandler (
this.webBrowser Window_onscroll );
}
catch (Exception ex)
{
MessageBox.Show (ex.ToString()) ;
}
}

private void webBrowserWindo w_onscroll()
{
MessageBox.Show ("scroll");
}

private void webBrowserWindo w_onscroll(msht ml.IHTMLEventOb j pEvtObj)
{
MessageBox.Show ("scroll2");
}

------

any idea on what I'm doing wrong?
thanks
Claudio

Aug 18 '06 #1
0 1695

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

Similar topics

3
10477
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 undefined, because Opera doesn't support this event. I use:
1
3407
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 detect this problem with a test like "if (textarea.onscroll == 'undefined' || !textarea.onscroll) {}." Any help would be appreciated.
2
6608
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... http://msdn.microsoft.com/library/en-us/dnwebteam/html/webteam02052001.asp?frame=true#scrolling Has anyone made this work successfully before?
1
12901
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 from Frontpage with Preview then the onscroll works - it calls the doOnScroll function and posts the alert when you move the scroll bar. It doesn't work if you go to this page from another page or if you refresh the page. What is going on here? Any...
0
2728
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 tag of my master page does nothing. Oh, IE is the browser. <body onscroll="alert('scrolling')"> I was able to get around this setting an event hander for window.onscroll. However, body.scrollTop is always 0! I wrote a plain aspx test...
0
2138
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. http://msdn.microsoft.com/workshop/browser/mshtml/reference/ifaces/window2/onscroll.asp http://msdn.microsoft.com/workshop/author/dhtml/reference/events/onscroll.asp another possibility seems to exist with IHTMLElement2.onscroll using the document body, but this does not solve the problem. the following code snippet...
2
2158
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 realized that the new DocType being used in 2.0 (<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">) is the culprit. Upon using the old 1.1 DocType (<!DOCTYPE HTML PUBLIC...
6
3463
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 am handling the event in Listbox selectedindexchanged. It is working well with a single selection. if I am making multiple
0
8330
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8746
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8523
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8626
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7355
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4334
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.