您的位置:首页 > 其它

调用默认浏览器打开指定网页

2012-07-19 15:18 429 查看
uses ShellAPI,Registry;

var
reg: TRegistry;
s: String;
begin
reg := TRegistry.Create;
reg.RootKey := HKEY_CLASSES_ROOT;
reg.OpenKey('HTTP\Shell\open\command',False);
s := reg.ReadString('');//读取注册表的值 如:"D:\Program Files\Maxthon3\Bin\Maxthon.exe" "%1"
s := Copy(s,Pos('"',s)+1,Length(s));//提取路径信息
s := Copy(s,1,Pos('"',s)-1);
ShellExecute(application.handle, 'open',PChar(s), PChar('http://www.ccqgn.com'), nil,sw_shownormal);//指定打开网页
end;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: