下面的函数是通过读取注册表的设置后,得到默认Internet的浏览器所在地址 uses Registry; function GetDefaultShellHTTP : string; var reg : TRegistry; begin Reg:=TRegistry.Create; Reg.RootKey:=HKEY_CLASSES_ROOT; if Reg.KeyExists('http\shell\open\command') then begin Reg.OpenKey('http\shell\open\command',false); Result:=Reg.ReadString(''); end else Result:=''; Reg.Free; end;设置internet浏览器 procedure SetDefaultShellHttp(CmdLine : string); var reg : TRegistry; begin Reg:=TRegistry.Create; Reg.RootKey:=HKEY_CLASSES_ROOT; //注册表的地址: Reg.OpenKey('http\shell\open\command',true);//注册表的地址: Reg.WriteString('',CmdLine); Reg.Free; end;setDefaultshellhttp('"C:\PROGRA~1\INTERN~1\iexplorer.exe" -nohome');
注册表路径:HKEY_CLASSES_ROOT\http\shell\open\command
uses
Registry;
function GetDefaultShellHTTP : string;
var
reg : TRegistry;
begin
Reg:=TRegistry.Create;
Reg.RootKey:=HKEY_CLASSES_ROOT;
if Reg.KeyExists('http\shell\open\command') then
begin
Reg.OpenKey('http\shell\open\command',false);
Result:=Reg.ReadString('');
end
else
Result:='';
Reg.Free;
end;设置internet浏览器
procedure SetDefaultShellHttp(CmdLine : string);
var
reg : TRegistry;
begin
Reg:=TRegistry.Create;
Reg.RootKey:=HKEY_CLASSES_ROOT; //注册表的地址:
Reg.OpenKey('http\shell\open\command',true);//注册表的地址:
Reg.WriteString('',CmdLine);
Reg.Free;
end;setDefaultshellhttp('"C:\PROGRA~1\INTERN~1\iexplorer.exe" -nohome');