Question

Comment créer votre propre surnom personnalisé (ou protocole URL) sur les systèmes Windows ?

Exemples:

  • http :
  • mail à :
  • service:

Autres conseils

Voici un ancien code Delphi que nous avons utilisé pour obtenir des raccourcis dans une application Web afin de démarrer un programme Windows localement pour l'utilisateur.

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;

À l'intérieur d'OLE de Craig Brockschmidt a probablement la meilleure couverture sur les surnoms.Si vous souhaitez approfondir un peu ce sujet, je vous recommande de vous procurer ce livre.Il est également contenu sur le disque MSDN fourni avec VS 6.0, au cas où vous l'auriez toujours.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top