TEditDesigner

Component implementing IHTMLEditHost

Needs Internet Explorer 5.5 or greater installed

 

IHTMLEditDesigner provides methods that enable clients using the editor to intercept Internet Explorer events so that they can change the editor's default behavior.

IHTMLEditDesigner interfaces are registered to receive event notification using the IHTMLEditServices interface. When an IHTMLEditDesigner interface has been registered, MSHTML will call its methods in response to Internet Explorer events.

The following code shows how to put the Webbrowsers desigmode on/off and how to connect and switch editdesigner:

 


var
ActiveDesigner: TEditDesigner;
EditServices: IHTMLEditServices;

procedure TForm1.SetDesignModeOn;
begin
while Embeddedwb1.Busy do Application.ProcessMessages;
(EmbeddedWB1.document as IHTMLDocument2).designMode := 'On';
end;

procedure TForm1.SetDesignModeOff;
begin
EditServices.RemoveDesigner(ActiveDesigner);
(EmbeddedWB1.document as IHTMLDocument2).designMode := 'Off';
end;

procedure TForm1.ConnectDesigner(EditDesigner: TEditDesigner);
begin
while Embeddedwb1.Busy do Application.ProcessMessages;
if Assigned(ActiveDesigner) then
EditServices.RemoveDesigner(ActiveDesigner);
(EmbeddedWB1.Document as IServiceProvider).Queryservice(SID_SHTMLEDITSERVICES, IID_IHTMLEditServices, EditServices);
EditServices.AddDesigner(EditDesigner);
ActiveDesigner := EditDesigner;
end;


procedure TForm1.Button1Click(Sender: TObject);
begin
embeddedwb1.go('http://www.euromind.com/iedelphi');
SetDesignModeOn;
ConnectDesigner(EditDesigner1);
end;

 

Links:

IHTMLEditServices Interface

IHTMLEditDesigner Interface


Implementing Edit Designers- The Basics


Implementing Edit Designers 2- The Annotator Sample

 

Enjoy!

 

Download EditDesigner component

EditDesigner Component for Delphi 4/5 (IE 5.5 or greater)

 

Created and maintained by
Per Lindsų Larsen

Last Update: January 14, 2001