【问题标题】:How do you create your own moniker (URL Protocol) on Windows systems?您如何在 Windows 系统上创建自己的名字对象(URL 协议)?
【发布时间】:2010-09-05 12:01:02
【问题描述】:

如何在 Windows 系统上创建自己的自定义名字对象(或 URL 协议)?

例子:

  • http:
  • 邮寄地址:
  • 服务:

【问题讨论】:

    标签: windows winapi moniker


    【解决方案1】:

    【讨论】:

    • 您的注册链接包含我想到的详细信息。 @Lasse 的回答也包含了细节。
    【解决方案2】:

    这里有一些旧的 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;
    

    【讨论】:

      【解决方案3】:
      来自 Craig Brockschmidt 的

      Inside OLE 可能对绰号有最好的报道。如果你想更深入地研究这个话题,我建议你买这本书。它也包含在随 VS 6.0 一起提供的 MSDN 磁盘中,以防您仍然拥有它。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-07-25
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多