如何在Windows系统上创建自己的自定义名字对象(或URL协议)?
示例:
答案 0 :(得分:4)
从MSDN查看Creating and Using URL Monikers,About Asynchronous Pluggable Protocols和Registering an Application to a URL Protocol
答案 1 :(得分:3)
以下是一些旧的Delphi代码,我们将其用作在Web应用程序中获取快捷方式的方法,以便为用户在本地启动Windows程序。
procedure InstallIntoRegistry;
var
Reg: TRegistry;
begin
Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_CLASSES_ROOT;
if Reg.OpenKey('moniker', True) then
begin
Reg.WriteString('', 'URL:Name of moniker');
Reg.WriteString('URL Protocol', '');
Reg.WriteString('Source Filter', '{E436EBB6-524F-11CE-9F53-0020AF0BA770}');
Reg.WriteInteger('EditFlags', 2);
if Reg.OpenKey('shell\open\command', True) then
begin
Reg.WriteString('', '"' + ParamStr(0) + '" "%1"');
end;
end else begin
MessageBox(0, 'You do not have the necessary access rights to complete this installation!' + Chr(13) +
'Please make sure you are logged in with a user account with administrative rights!', 'Access denied', 0);
Exit;
end;
finally
FreeAndNil(Reg);
end;
MessageBox(0, 'Application WebStart has been installed successfully!', 'Installed', 0);
end;
答案 2 :(得分:0)
Inside OLE 可能是对绰号最好的报道。如果你想深入研究这个主题,我建议你拿这本书。它也包含在VS 6.0附带的MSDN磁盘上,如果你还有它。