参考博客: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>