Hi,

I'm trying to respond to a html button-click event from within Delphi
using the Mozilla ActiveX component.

This is as far as I've gotten:
function HTMLButtonClick(e: IHTMLEventObj) : Boolean;
begin
  ShowMessage('Delphi function fired!');
end;

procedure TForm1.MozillaBrowser1DocumentComplete(ASender: TObject;
  const pDisp: IDispatch; var URL: OleVariant);
var
  doc : IHTMLDocument2;
  docAll: IHTMLElementCollection;
  btnElement: IHTMLElement;
begin
  doc := MozillaBrowser1.Document As IHTMLDocument2;
  docAll := doc.all;
  btnElement := docAll.item('button1',-1) as IHTMLElement;
  btnElement.setAttribute(WideString('value'),'New Value',0);
end;

I am not sure of the HTMLButtonClick signature or how to assign the
function (or should it be a procedure?) to the onclick event of
btnElement.

I've tried everything I can think of and this is driving me nuts.

Any help will be appreciated.

Regards
Lester

_______________________________________________
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding

Reply via email to