Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem: HTMLDocumentEvents doesn't work on Gmail

10 views
Skip to first unread message

weirdo3d

unread,
May 31, 2007, 8:00:43 AM5/31/07
to
I want to capture certain events on websites. I'm using IWebBrowser2
and HMTLDocumentEvents. Basically, I'm interested in OnClick event of
HTMLDocumentEvents. On DocumentComplete event, I connect the
HtmlDocumentEvent object. Things work fine on most of the cites, I get
the Onclick event, but on certain sites, that do a lot of loading
(frames),e.g. Gmail, I don't get any event. I went through these two
articles.

http://support.microsoft.com/kb/180366/
http://support.microsoft.com/kb/246247

and now my code looks like this

gpDisp := nil;

procedure TMyBhoObject.NavigateComplete2(Sender: TObject;
const pDisp: IDispatch; var URL: OleVariant);
begin
if gpDisp = nil then
gpDisp := pDisp;
end;

procedure TMyBhoObject.DocumentComplete(Sender: TObject;
const pDisp: IDispatch; var URL: OleVariant);
begin

if (pDisp = gpDisp) then
begin

FSinkComponent.Connect(WebBrowser.Document as IHTMLDocument2);

FSinkComponent.onClick := DocumentOnClick;
FSinkComponent.onkeypress := DocumentOnKeyPress;

gpDisp := nil;

end;
end;

Can anyone please help me out in tracing the problem. OnClick doesn't
work when i run this on Gmail... it works otherwise.
I'm using Delphi2006 on WindowsXP, but any help or reference would be
appreciated.

Thankyou!

Ahmed

0 new messages