How to open a web site with the default web browser in a NEW window
http://delphi.about.com/cs/adptips2004/a/bltip0504_4.htm
When using ShellExecute (as explained in the above article) to open a web site or a htm file with the default web browser you *don't* have the option to specify that you want to start a new instance of the browser - in general an existing window is used.
To make sure a new window is created we need to call the ShellExecute function a little differently - by specifying the URL as a parameter to a call to your default browser (an application associated with the htm and html, etc extension).
uses
Registry, ShellAPI; function BrowseURL(const URL: string) : boolean;
var
Browser: string;
begin
Result := True;
Browser := '';
with TRegistry.Create do
try
RootKey := HKEY_CLASSES_ROOT;
Access := KEY_QUERY_VALUE;
if OpenKey('\htmlfile\shell\open\command', False) then
Browser := ReadString('') ;
CloseKey;
finally
Free;
end;
if Browser = '' then
begin
Result := False;
Exit;
end;
Browser := Copy(Browser, Pos('"', Browser) + , Length(Browser)) ;
Browser := Copy(Browser, , Pos('"', Browser) - ) ;
ShellExecute(, 'open', PChar(Browser), PChar(URL), nil, SW_SHOW) ;
end; //Usage
BrowseURL('http://www.cnblogs.com') ;
How to open a web site with the default web browser in a NEW window的更多相关文章
- Windows Azure Web Site (15) 取消Azure Web Site默认的IIS ARR
<Windows Azure Platform 系列文章目录> 我们知道,Azure Web Site (改名为Azure Web App)默认是可以保留Session的.Azure We ...
- Azure Web Site 之 利用Azure Web site 发布网站
由于经常混迹于MSDN Azure论坛,少不了和一些外国朋友打交道.有的时候觉得还是有一些东西可以写出来与外国友人们分享下的, 所以就用一个开源项目建了一个英文blog项目. 在发布的时候,首选的就是 ...
- Web site collections
Integration 伯乐在线 极客头条 Hacker News Stack Overflow RFC Search Security Python Hacker - Freebuf PrimalS ...
- eclipse插件在线发布发布和版本更新(web site) 转
欢迎关注我的社交账号: 博客园地址: http://www.cnblogs.com/jiangxinnju/p/4781259.html GitHub地址: https://github.com/ji ...
- Eclipse plugin web site 发布和版本更新
Eclipse plugin web site 发布和版本更新 在eclipse插件开发过程中免不了要发布1.0, 1.1, 1.2…….等等,随着版本的递增,假如每次都发布一个插件zip包,那使用者 ...
- Microsoft Azure Web Sites应用与实践【2】—— 通过本地IIS 远程管理Microsoft Azure Web Site
Microsoft Azure Web Sites应用与实践 系列: [1]—— 打造你的第一个Microsoft Azure Website [2]—— 通过本地IIS 远程管理Microsoft ...
- Azure China (7) 使用WebMetrix将Web Site发布至Azure China
<Windows Azure Platform 系列文章目录> 本章介绍的是,使用世纪互联运维的Azure云服务. 1.首先我们登陆Azure管理界面.http://manage.wind ...
- Windows Azure Web Site (6) 使用FTP发布Azure Web Site
<Windows Azure Platform 系列文章目录> 笔者在之前的文章中介绍的都是使用IDE,也就是Visual Studio,将本地的aspx发布到Azure Web Site ...
- Windows Azure Web Site (7) Web Site配置
<Windows Azure Platform 系列文章目录> 在上一章内容中,我们已经部署了Azure WebSite.我们可以在Web Site配置页面进行配置.如下图: 另外,我们还 ...
随机推荐
- UVALive 3668 A Funny Stone Game
题目链接:UVALive - 3668 题目大意为给定n堆石子,每次的操作是选择三个数i<j<=k,从i中拿一枚石子,在j和k中分别放入一枚石子.不能操作者输.求先手是否能赢,若可以,则输 ...
- HDU 6205 2017沈阳网络赛 思维题
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6205 题意:给你n堆牌,原本每一堆的所有牌(a[i]张)默认向下,每次从第一堆开始,将固定个数的牌(b ...
- .pnts点云
一种3d tiles格式 MIME格式: <configuration> <system.webServer> <staticContent> <remove ...
- 发布PHP项目(nginx+PHP7+mysql 5.6)
一.环境检查 1.检查nginx ps -ef | grep "nginx" 显示如下内容则代表nginx启动正常 root 3285 1 0 12:57 ? 00:00:00 n ...
- 20165301实验二java面向对象程序设计
20165301实验二java面向对象程序设计 实验目的与要求(提交点一): 参考http://www.cnblogs.com/rocedu/p/6371315.html#SECUNITTEST完成单 ...
- csu 1548(三分)
1548: Design road Time Limit: 2 Sec Memory Limit: 256 MBSubmit: 383 Solved: 200[Submit][Status][We ...
- 开始学习MaxCompute
https://help.aliyun.com/document_detail/34615.html?spm=a2c4g.11186623.6.688.jVxTMW
- [实战]MVC5+EF6+MySql企业网盘实战(23)——文档列表
写在前面 上篇文章实现了图片列表,这篇文章实现文档列表将轻车熟路,因为逻辑基本相似,只是查询条件的不同.这里将txt,doc,docx,ppt,pptx,xls,xlsx的文件都归为文档列表中. 系列 ...
- 【LOJ】#2012. 「SCOI2016」背单词
题解 我们发现第一种操作肯定不可取,每个节点里它最近的点是它最长出现过的后缀,发现这就是AC自动机的fail节点,根据fail的关系这会是一棵树,而一个单词的前一个序号最大的后缀必定是它的父亲 然后我 ...
- HDU 6186 CS Course
保存前缀后缀. 保存一下前缀和后缀,去掉第$i$个位置,就是$L[i-1]$和$R[i+1]$进行运算. #include<bits/stdc++.h> using namespace s ...