Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Capturing mousedown on my pages

$
0
0
Capturing mousedown on my pages
.NET Development
Capturing mousedown on my pages
02/08/2012
02:30:47 AM
3FF05DY6E Show this entire thread in new window
Gratar Image based on email address
From:
To:
All 
Attachments:
None
Hi, I'm using MouseDown event to get HTMLElement information at runtime.
To avoid the click freeze I used the solution described in this site and it works very well.

The solution can be summarized as follow:

After defining

public delegate void DHTMLEvent(IHTMLEventObj e);

public class DHTMLEventHandler
{
public DHTMLEvent Handler;
HTMLDocument Document;

public DHTMLEventHandler(HTMLDocument doc)
{
this.Document = doc;
}
[DispId(0)]
public void Call()
{
Handler(Document.parentWindow.@event);
}
}


we can summon a clickHandler in this way:

doc = axDocument.Document as HTMLDocument;
DHTMLEventHandler Handler = new DHTMLEventHandler(doc);
Handler.Handler += new DHTMLEvent(ClickEventHandler);
((mshtml.DispHTMLDocument)doc).onmousedown = Handler;

defining the clickEventHandler to do all we want.

This is perfect and works, but it doesn't work in some situations:

- if I try to detect my mouseClick when I use Outlook Web Access the event doesn't fire.
- if I try to detect my mouseClick when I use my personal mail in www.email.it the event doesn't fire.

Why not? Are there any features in those pages that can break the event handler mechanism above?

Thank you very much for any help,

Pietro



Viewing all articles
Browse latest Browse all 10393

Trending Articles