Webbrowser : tout sélectionner puis copier dans le presse-papier

uses ActiveX;

procedure TForm1.Button1Click(Sender: TObject);
begin
webbrowser1.navigate('http://fobec.com');
end;

procedure TForm1.Button2Click(Sender: TObject);
var
vInput, vOutput: OleVariant;
begin
WebBrowser1.ExecWB(OLECMDID_SELECTALL, 0, vInput, vOutput);
WebBrowser1.ExecWB(OLECMDID_COPY, 0, vInput, vOutput);
end;

initialization
OleInitialize(nil);

finalization
OleUninitialize;

end.
{autres commandes disponibles
OLECMDID_OPEN = 1;
OLECMDID_NEW = 2;
OLECMDID_SAVE = 3;
OLECMDID_SAVEAS = 4;
OLECMDID_SAVECOPYAS = 5;
OLECMDID_PRINT = 6;
OLECMDID_PRINTPREVIEW = 7;
OLECMDID_PAGESETUP = 8;
OLECMDID_SPELL = 9;
OLECMDID_PROPERTIES = 10;
OLECMDID_CUT = 11;
OLECMDID_COPY = 12;
OLECMDID_PASTE = 13;
OLECMDID_PASTESPECIAL = 14;
OLECMDID_UNDO = 15;
OLECMDID_REDO = 16;
OLECMDID_SELECTALL = 17;
OLECMDID_CLEARSELECTION = 18;
OLECMDID_ZOOM = 19;
OLECMDID_GETZOOMRANGE = 20;
OLECMDID_UPDATECOMMANDS = 21;
OLECMDID_REFRESH = 22;
OLECMDID_STOP = 23;
OLECMDID_HIDETOOLBARS = 24;
OLECMDID_SETPROGRESSMAX = 25;
OLECMDID_SETPROGRESSPOS = 26;
OLECMDID_SETPROGRESSTEXT = 27;
OLECMDID_SETTITLE = 28;
OLECMDID_SETDOWNLOADSTATE = 29;
OLECMDID_STOPDOWNLOAD = 30;
OLECMDID_ONTOOLBARACTIVATED = 31;
OLECMDID_FIND = 32;
OLECMDID_DELETE = 33;
OLECMDID_HTTPEQUIV = 34;
OLECMDID_HTTPEQUIV_DONE = 35;
OLECMDID_ENABLE_INTERACTION = 36;
OLECMDID_ONUNLOAD = 37;
OLECMDID_PROPERTYBAG2 = 38;
OLECMDID_PREREFRESH = 39;}
Ajouter un commentaire
Pseudo
Adresse email
Site internet (optionnel)
Votre commentaire
Fiche de l'article
Mise a jour28/04/2009
VisualisationVu 1925 fois
PublicInternaute zz
CategorieDelphi - Trucs et astuces - Internet
Auteur de l'article
fobec fobec
connecté le 28/07/2016
41 ans - France Nord-Est
39 articles dans la section
Contacter l'auteur