Hello again.
I am embedding mozilla using mfcembed example.
I would like to generate click events on anchor elements of the page (to
simulate a user clicking a link on some page).
I see two different ways of doing that:
1) Force embedded Mozilla to execute a JavaScript program like the
following:
b = document.getElementById("button1");
res = b.dispatchEvent("click");
if ( res ) {
// event dispatch was successful
b.disabled = true;
}
How can I force embedded Mozilla to execute my JS programs?
2) Use C++ code to create new event and to dispatch it:
nsCOMPtr<nsIDOMEvent> domEvent = do_CreateInstance(??????????, &rv );
element->dispatchEvent(domEvent, &bool);
Here I do not know how to create such new component that it would
implement nsIDOMEvent interface.
I hope this helps explain what I would like to do .
Thank you again for any further help.
Jure
"Patrick Griffiths" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> What are you trying to do? There might be an easier/more straightforward
> way.
>
> > -----Original Message-----
> > From: Jure Ferlez [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, January 10, 2002 9:57 AM
> > To: [EMAIL PROTECTED]
> > Subject: How to create a DOMEvent in C++ ???
> >
> >
> > Hello.
> >
> > I would like to use the
> >
> > NS_IMETHOD DispatchEvent(nsIDOMEvent *evt, PRBool *_retval) = 0;
> >
> > method of the nsIDOMEventTarget interface.
> >
> > How do I create the appropriate Event component (that represents mouse
> > click) that implements the nsIDOMEvent interface ?
> >
> > Thank you very much for any help.
> >
> > Jure
> >
> >
> >
> >
> >
> >
> >
>