I"m trying to capture the body onload event to determine if one is running
when a website loads using mshtml in a win form... I'm writing in c# and
this is the code I have I just can't seem to get access to the onload event,
I have the pointer to the event I believe in the second line of code it is
body.onload, however I'm not sure how to fire this event since
mshtml.HTMLDocumentEvents2_Event doesn't have a onload event handler to
use... Is this possible? am I just using the wrong event object? The code
is below, thanks in advance.
inside DocumentComplete...
IHTMLDocument2 doc = (IHTMLDocument2)this.axWebBrowser1.Document;
IHTMLBodyElement body = doc.body;
mshtml.HTMLDocumentEvents2_Event iEvent;
iEvent = (mshtml.HTMLDocumentEvents2_Event) doc;
/*
iEvent doesn't have onload?
iEvent = (mshtml.HTMLDocumentEvents2_Event) doc;
iEvent.onactivate += new
mshtml.HTMLInputImageEvents_onactivateEventHandler(doLoad);
*/
onload event is fired by window object (accessible as
document.parentWindow) via HTMLWindowEvents source interface.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
This question does not make any sense to me, sorry.
window.onload != null