procedure RegisterFileType(software_protocol:
String; software_name:
String; software_pfad:
String) ;
var
reg:TRegistry;
software_regedit_pfad:
String;
begin
reg := TRegistry.Create;
try
// Erster Eintrag
reg.RootKey:=HKEY_CLASSES_ROOT;
software_regedit_pfad:='
';
reg.CreateKey(software_regedit_pfad+software_protocol);
reg.OpenKey(software_regedit_pfad+software_protocol, True) ;
reg.WriteString('
','
URL:'+software_protocol+'
Protocol');
reg.WriteString('
URL Protocol','
');
reg.CloseKey;
reg.CreateKey(software_regedit_pfad+software_protocol+'
\DefaultIcon');
reg.OpenKey(software_regedit_pfad+software_protocol+'
\DefaultIcon', True) ;
reg.WriteString('
',software_name);
reg.CloseKey;
reg.CreateKey(software_regedit_pfad+software_protocol+'
\shell');
reg.OpenKey(software_regedit_pfad+software_protocol+'
\shell', True) ;
reg.WriteString('
','
');
reg.CloseKey;
reg.CreateKey(software_regedit_pfad+software_protocol+'
\shell\open');
reg.OpenKey(software_regedit_pfad+software_protocol+'
\shell\open', True) ;
reg.WriteString('
','
');
reg.CloseKey;
reg.CreateKey(software_regedit_pfad+software_protocol+'
\shell\open\command');
reg.OpenKey(software_regedit_pfad+software_protocol+'
\shell\open\command', True) ;
reg.WriteString('
',software_pfad+software_name+'
%1');
reg.CloseKey;
// Zweiter Eintrag
reg.RootKey:=HKEY_LOCAL_MACHINE;
software_regedit_pfad:='
Software\Classes\';
reg.CreateKey(software_regedit_pfad+software_protocol);
reg.OpenKey(software_regedit_pfad+software_protocol, True) ;
reg.WriteString('
','
URL:'+software_protocol+'
Protocol');
reg.WriteString('
URL Protocol','
');
reg.CloseKey;
reg.CreateKey(software_regedit_pfad+software_protocol+'
\DefaultIcon');
reg.OpenKey(software_regedit_pfad+software_protocol+'
\DefaultIcon', True) ;
reg.WriteString('
',software_name);
reg.CloseKey;
reg.CreateKey(software_regedit_pfad+software_protocol+'
\shell');
reg.OpenKey(software_regedit_pfad+software_protocol+'
\shell', True) ;
reg.WriteString('
','
');
reg.CloseKey;
reg.CreateKey(software_regedit_pfad+software_protocol+'
\shell\open');
reg.OpenKey(software_regedit_pfad+software_protocol+'
\shell\open', True) ;
reg.WriteString('
','
');
reg.CloseKey;
reg.CreateKey(software_regedit_pfad+software_protocol+'
\shell\open\command');
reg.OpenKey(software_regedit_pfad+software_protocol+'
\shell\open\command', True) ;
reg.WriteString('
',software_pfad+software_name+'
%1');
reg.CloseKey;
// Dritter Eintrag
reg.RootKey:=HKEY_CURRENT_USER;
software_regedit_pfad:='
Software\Classes\';
reg.CreateKey(software_regedit_pfad+software_protocol);
reg.OpenKey(software_regedit_pfad+software_protocol, True) ;
reg.WriteString('
','
URL:'+software_protocol+'
Protocol');
reg.WriteString('
URL Protocol','
');
reg.CloseKey;
reg.CreateKey(software_regedit_pfad+software_protocol+'
\DefaultIcon');
reg.OpenKey(software_regedit_pfad+software_protocol+'
\DefaultIcon', True) ;
reg.WriteString('
',software_name);
reg.CloseKey;
reg.CreateKey(software_regedit_pfad+software_protocol+'
\shell');
reg.OpenKey(software_regedit_pfad+software_protocol+'
\shell', True) ;
reg.WriteString('
','
');
reg.CloseKey;
reg.CreateKey(software_regedit_pfad+software_protocol+'
\shell\open');
reg.OpenKey(software_regedit_pfad+software_protocol+'
\shell\open', True) ;
reg.WriteString('
','
');
reg.CloseKey;
reg.CreateKey(software_regedit_pfad+software_protocol+'
\shell\open\command');
reg.OpenKey(software_regedit_pfad+software_protocol+'
\shell\open\command', True) ;
reg.WriteString('
',software_pfad+software_name+'
%1');
reg.CloseKey;
finally
reg.Free;
end;
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST,
nil,
nil) ;
end;