manipulando Internet Explorer
Gostaria de saber se existe como modificar a página que está sendo exibida como a inicial no internet explorer via delphi?
Mineiro
Curtidas 0
Respostas
Marcelo Saviski
12/05/2003
[color=blue:75f1431e4a]isso define a página inicial[/color:75f1431e4a]
var Reg: TRegistry; SubKey: String; begin begin Reg := TRegistry.Create; Reg.RootKey := HKEY_CURRENT_USER; SubKey := ´\Software\Microsoft\Internet Explorer\Main\´; Reg.Access := KEY_ALL_ACCESS; Reg.OpenKey(SubKey, False); Reg.WriteString(´Start Page´, StartPage); Reg.CloseKey; Reg.Free; end
GOSTEI 0
Mineiro
12/05/2003
não entendi o codigo, onde entra o nome da minha página inicial?
GOSTEI 0
Dantonds
12/05/2003
Acho q o código q vc quer é esse :
Espero ter ajudado.(naum se esqueças de declarar no user registry)
implementation
Uses Registry;
{$R *.DFM}
function GetIEStartPage : string;
Var
Reg : TRegistry;
begin
Reg:= TRegistry.Create;
try
Reg.RootKey:= HKEY_CURRENT_USER;
Reg.OpenKey(´Software\Microsoft\Internet Explorer\Main´,false);
try
result := Reg.ReadString(´Start Page´);
except
result := ´´;
end;
Reg.CloseKey;
finally
Reg.Free;
end;
end;
function SetIEStartPage(APage : string) : boolean;
Var
Reg : TRegistry;
begin
Reg:= TRegistry.Create;
try
Reg.RootKey:= HKEY_CURRENT_USER;
Reg.OpenKey(´Software\Microsoft\Internet Explorer\Main´,false);
try
Reg.WriteString(´Start Page´,APage);
result := true;
finally
Reg.CloseKey;
result := false;
end;
finally
Reg.Free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);{Aqui vc vê qual a página inicial}
begin
ShowMessage(GetIEStartPage);
end;
procedure TForm1.Button2Click(Sender: TObject);{Aqui vc altera a página inicial}
begin
SetIEStartPage(´www.napoles.hpg.com.br´);
end;
end.Espero ter ajudado.(naum se esqueças de declarar no user registry)
GOSTEI 0