Autor Beitrag
Palmetshofer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44



BeitragVerfasst: So 11.08.02 12:26 
Ich hab hier eine procedur mit der man eigene dateitypen registrieren kann. Ich habe jetzt eine konkrete frage zu dem code hier:

ausblenden volle Höhe Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
procedure TForm1.RegisterFileType(prefix: string; exepfad: string); 
var 
  reg: TRegistry; 
begin 
  reg := TRegistry.Create; 
  try 
    reg.RootKey := HKEY_CLASSES_ROOT; 
    //create a new key  --> .pci 
    reg.OpenKey('.' + prefix, True); 
    try 
      //create a new value for this key --> pcifile 
      reg.Writestring('', prefix + 'file'); 
    finally 
      reg.CloseKey; 
    end; 
    //create a new key --> pcifile 
    reg.CreateKey(prefix + 'file'); 
    //create a new key pcifile\DefaultIcon 
    reg.OpenKey(prefix + 'file\DefaultIcon', True); 
    //and create a value where the icon is stored --> c:\project1.exe,0 
    try 
      reg.Writestring('', exepfad + ',0'); 
    finally 
      reg.CloseKey; 
    end; 
    reg.OpenKey(prefix + 'file\shell\open\command', True); 
    //create value where exefile is stored --> c:\project1.exe "%1" 
    try 
      reg.Writestring('', exepfad + ' "%1"'); 
    finally 
      reg.CloseKey; 
    end; 
  finally 
    reg.Free; 
  end; 
  SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nil, nil); 
end;


ich weis nicht was ich da alles ändern muss damit das wieder "unRegistriert" wird!!

und gibt es da eine bessere lösung als den code ???

mfg Matthias

P.S.: Wenn das nicht in diese Sparte pass bitte verschieben. Ich weiß man soll sich das vorher überlegen aber es gibt hier nichts zum Thema System!

_________________
Menschen stolpern nicht über Berge, sondern über Maulwurfshügel.
Konfuzius
cbs
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 207
Erhaltene Danke: 1



BeitragVerfasst: So 11.08.02 12:29 
Tag auch

dürfte doch einfach sein. sämtliche schlüssel/werte die du mit dem code erstellst (und damit einen dateityp registrierst) einfach löschen

oder isses nicht so einfach?