网页超链接调用应用程序实现

参考博客:http://www.cnblogs.com/glorysword/archive/2012/08/07/2626008.html

基于BCB的程序设计实现

1.BCB程序实现关键代码

	// 页写入网页调用
	TRegistry *Registry1 = new TRegistry;
	Registry1->RootKey = HKEY_CLASSES_ROOT;
	UnicodeString path = "\\Test";
	if(Registry1->OpenKey(path, true)==false)
		ShowMsg(this,"读取注册表失败,没有读取注册表权限,请联系系统管理员!");
	IsNeedDeleteOldVerSoftwareInfo = false;
	if (Registry1->ReadString("") != "URL:Test Protocol") {
		Registry1->WriteString("", "URL:Test Protocol");
		IsNeedDeleteOldVerSoftwareInfo = true;
	}
	if (IsNeedDeleteOldVerSoftwareInfo)
		Registry1->WriteString("URL Protocol", "");

	Registry1->OpenKey(path + "\\DefaultIcon", true);
	strAppPath = Registry1->ReadString("");
	if (strAppPath != ("\"" + Application->ExeName + "\""))
		Registry1->WriteString("", "\"" + Application->ExeName + "\"");

	path += "\\shell\\open\\command";
	Registry1->OpenKey(path, true);
	strAppPath = Registry1->ReadString("");
	UnicodeString ExePath = "\"" + Application->ExeName + "\" " + "%1";
	if (strAppPath != ExePath)
		Registry1->WriteString("", ExePath);

	strAppPath = Registry1->ReadString("OldDefault");
	if (strAppPath != ExePath)
		Registry1->WriteString("OldDefault", ExePath);

	delete Registry1;
	/结束


2.网页(html)的设计实现

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
</head>
<body>
 
 <a href="Test://aaaaaaaaa/">即时通讯</a>
 	  
</body>
</html>


 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值