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配置页面进行配置.如下图: 另外,我们还 ...
随机推荐
- [转载]FFmpeg完美入门[4] - FFmpeg应用实例
1 用FFserver从文件生成流媒体 一.安装ffmpeg 在ubuntu下,运行sudo apt-get ffmpeg 安装ffmpeg,在其他linux操作系统下,见ffmpeg的编译过程(编译 ...
- 批量删除.svn文件夹和.svn文件
新建可运行文件 Windows环境 将下面的代码保存为 kill-svn.bat文件,放到要删除.svn文件的目录下,双击运行即可 @echo on @rem 删除SVN版本控制目录 @rem for ...
- POJ 2337 Catenyms(欧拉回(通)路:路径输出+最小字典序)
题目链接:http://poj.org/problem?id=2337 题目大意:给你n个字符串,只有字符串首和尾相同才能连接起来.请你以最小字典序输出连接好的单词. 解题思路:跟POJ1386一个意 ...
- 1、量化投资—为什么选择Python?
Python在量化领域的现状 就跟Java在web领域无可撼动的地位一样,Python也已经在金融量化投资领域占据了重要位置,从各个业务链条都能找到相应的框架实现. 在量化投资(证券和比特币)开源项目 ...
- flask-login 学习(1)
今天的目标,就是学习 flask-login.争取用1天时间,掌握个大概. 第一步:掌握flask-login的大致使用,具体参考了:https://www.centos.bz/2017/09/fla ...
- BFC(块级格式化上下文)
渲染规则 1.内部的box会在垂直方向,一个接一个的放置 2.box垂直方向的距离由margin决定,属于同一个bfc的两个相邻box的margin会发生重叠 3.每个元素的margin box的左边 ...
- 微信小程序-怎么获取当前页面的url
getCurrentPages() 函数用于获取当前页面栈的实例,以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面. https://developers.weixin.qq.com ...
- JavaScript“并非”一切皆对象
上一篇:<函数声明和函数表达式--函数声明和函数表达式的异同> p{font-size:14px; } 写在前面 网上非常多都在说"JavaScript一切皆对象",那 ...
- day2 字典常用的方法
字典创建的方式: (1)d1 = {"k1":"v1","k2":"v2","k3":&qu ...
- bzoj 1483 链表 + 启发式合并
思路:将颜色相同的建成一个链表, 变颜色的时候进行链表的启发式合并.. 因为需要将小的接到大的上边,所以要用个f数组. #include<bits/stdc++.h> #define LL ...