unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls, SHDocVw, StdCtrls,
ActiveX;
type
TForm1 =
class(TForm)
WebBrowser1: TWebBrowser;
Button1: TButton;
procedure FormShow(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormShow(Sender: TObject);
begin
WebBrowser1.Navigate('
http://www.google.ch/');
while WebBrowser1.ReadyState <> READYSTATE_COMPLETE
do application.processmessages;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
try
WebBrowser1.ExecWB(OLECMDID_SELECTALL, OLECMDEXECOPT_DODEFAULT);
WebBrowser1.ExecWB(OLECMDID_COPY, OLECMDEXECOPT_DODEFAULT);
except
end;
end;
initialization
OleInitialize(
nil);
finalization
OleUninitialize;
end.