How to search text from Lazarus in google? Put on your form TEdit component and TButton. In uses put lclintf to use command OpenUrl, set up variables, see my code
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, lclintf,
StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
var
search_text : WideString;{initiate variable for searched text}
google_address : WideString;{initiate variable for base google address}
web_address : WideString;{initiate variable for the whole google address}
begin
google_address := 'https://www.google.com/?gws_rd=ssl#q=';
{setting up variable for base google address}
search_text := Edit1.Text;
{setting up variable for text taken from Edit1 component}
web_address := google_address + search_text;
{adding search text to base google address}
OpenURL (web_address);
{open default browser and search text in google}
end;
end.