Autor Beitrag
danielpt
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 81

Windows 2000 Professional SP4
D6 Personal
BeitragVerfasst: Mi 29.10.03 20:52 
hi leutz!

Ich will mal einen CD-Autorun für Worms schreiben. Mein Problem: Das Programm startet zwar, hängt sich dann allerdings wieder auf :D

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
procedure TForm1.Button5Click(Sender: TObject);
var var2:string;
begin
  reg := TRegistry.Create(KEY_READ);
 try
  reg.Rootkey := HKEY_CURRENT_USER;
  reg.OpenKey('Software\Team17SoftwareLTD\WormsArmageddon', true);
  var2 := reg.ReadString('PATH');
 finally
  if var2 <> '' then begin
   ShellExecute(Application.Handle, 'open' ,PChar('WA.exe'), nil, PChar(ExtractFileDir(var2)), sw_ShowNormal);
  end;
  reg.free;
 end;
end;


Das wäre die Source... Die Registry-Einträg sind erstellt...

Bitte hilfe! thx & greetz

_________________
cu daniel
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 30.10.03 02:40 
Du schließt den Schlüssel nicht wieder. Eventuell ist es das.
danielpt Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 81

Windows 2000 Professional SP4
D6 Personal
BeitragVerfasst: Do 30.10.03 07:56 
Was meinst du damit? Ich bin genau nach dem Tutorial von Chatfix vorgegangen :oops:

Kannst du mir das bitte erklären? oder einen Tipp wo ich sowas finden kann?

thx

_________________
cu daniel
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: Do 30.10.03 10:10 
ausblenden Delphi-Quelltext
1:
Reg.CloseKey;					

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)
danielpt Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 81

Windows 2000 Professional SP4
D6 Personal
BeitragVerfasst: Do 30.10.03 10:42 
danke, geht aber leider immernoch nicht :cry:

_________________
cu daniel
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mo 03.11.03 10:36 
CloseKey wird so weit ich weit im Destructor aufgerufen. Daran sollte es also nicht liegen.

danielpt hat folgendes geschrieben:
Das Programm startet zwar, hängt sich dann allerdings wieder auf

An welcher Stelle im Code hängt sich das Programm auf?

Gruß
Tino