Autor Beitrag
Peter_Lustig
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 31



BeitragVerfasst: Di 20.09.05 09:12 
Hallo Leute, ich hab da mal ne Frage:

Ich möchte gern ein Programm in dem Autostarteintarg kopieren, weiß aber absolut nicht wie ich das anstellen soll. (Mit dem anderen Einträgen im Forum kann ich leider nicht viel anfangen)
Ich bräuchte mal so was wie leicht verständliche Anleitung/QuellCode.

Gruß Peter_Lustig
mehmeh
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 97

WIN XP
D5 Prof
BeitragVerfasst: Di 20.09.05 09:21 
Ich hatte auch probs, aber geh mal hier drauf da steht der code drin, wie man es macht.
www.delphi-forum.de/...;highlight=autostart
Dami hab ich es hinbekommen.
Peter_Lustig Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 31



BeitragVerfasst: Di 20.09.05 09:36 
Den gleichen Tread hatte ich auch schon, aber wenn ich den Code eingefügt habe, kommt die Fehlernachricht:
Unbekannter Bezeichner.

Wo kommt der Eintrag
ausblenden Delphi-Quelltext
1:
2:
3:
4:
var
  MyReg:TRegistry;
...
  MyReg:=TRegistry.Create;

hin?

Bei "var form1;" oder wo?

Könntest du mir vielleicht mal deinen QuellCode posten oder mir schicken?

Gruß Peter_Lustig

Moderiert von user profile iconTino: Delphi-Tags hinzugefügt.
mehmeh
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 97

WIN XP
D5 Prof
BeitragVerfasst: Di 20.09.05 09:45 
ausblenden Delphi-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:
procedure ...
var  
  MyReg:TRegistry;  

begin

  MyReg:=TRegistry.Create;  

 
  // Als Autostart eintragen  
    try  
      MyReg.RootKey:=hkey_local_machine;  
      MyReg.OpenKey('Software\Microsoft\Windows\CurrentVersion\Run', true);  
      MyReg.WriteString('Session-Logger',Application.ExeName);  
      MyReg.CloseKey;  
    finally  
      MyReg.Free;  
    end  
    
  // Eintrag löschen  
    try  
      MyReg.RootKey:=hkey_local_machine;  
      MyReg.OpenKey('Software\Microsoft\Windows\CurrentVersion\Run', false);  
      if MyReg.ValueExists('Session-Logger') then  
        MyReg.DeleteValue('Session-Logger');  
      MyReg.CloseKey;  
    finally  
      MyReg.Free;  
    end;

end;

so und jetzt oben in die uses Registry hineinnehmen

Moderiert von user profile iconGausi: Code- durch Delphi-Tags ersetzt
Peter_Lustig Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 31



BeitragVerfasst: Di 20.09.05 11:16 
OH, geil!!!!
Es aht geklappt.
ich danke dir :D
klezmor
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 558


delphi 6 personal delphi 2005 personal
BeitragVerfasst: Di 27.09.05 16:50 
Für was steht das Eintrag löschen, was soll dort gelöscht werden?
Nowo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 108



BeitragVerfasst: Mi 04.10.06 14:27 
falls du z.B. eine uninstall schreibst... sollte der registry-eintrag ebenfalls entfernt werden.
Sonst müsstest du in manuel löschen/suchen.