Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Jan : Get and CHANGE Body tag
| Subject: | Get and CHANGE Body tag |
| Posted by: | "Eddie Shipman" (mrbaseball34@no_spam_gmail.com) |
| Date: | Thu, 12 Jan 2006 09:21:35 |
I need to be able to add an empty event handler to the BODY tag
of ANY PAGE opened in TWebBrowser. I won't go into specifics
about why but how would I be able to do that except that I
am trying to sink the onmouseup.
i.e.
Here's an existing BODY tag:
<body bgcolor="white" text="black" link="blue"
vlink="purple" alink="red"
onload="if(showscoreboard){init();}
if(showbbfacts){startscroll();}">
I'd like to add an emtpy event "marker"
<body bgcolor="white" text="black" link="blue"
vlink="purple" alink="red"
onmouseup=""
onload="if(showscoreboard){init();}
if(showbbfacts){startscroll();}">
I have before been able to modify SCRIPT tag CONTENTS and CSS
STYLE tag attributes but modifying the BODY tag to add an event
marker is looking more difficult to me. Here's my attempt:
var
mu: OleVariant;
vA: IHTMLElement;
FEventDisp: IDispatch;
begin
// This doesn't work, get
// Could not convert variant of type (OleStr) into type (IDispatch)
mu := '';
vA.setAttribute('onmouseup', mu, 0);
{
// This doesn't work either, get
// Could not convert variant of type (Null) into type (IDispatch)
mu := varNull;
vA.setAttribute('onmouseup', mu, 0);
}
FEventDisp := IDispatch(vA.onmouseup);
vA.onmouseup := OleVariant(Self as IDispatch);
end;