Autor Beitrag
Death666Metal
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 22

Win XP
Delphi 7/html/php/flash/basic/c++
BeitragVerfasst: So 09.07.06 12:01 
Hallo!
Mal wieder ne Frage.... Ich möchte für meinen Clan nen Tool basteln, wo die die ganzen Communikation-Tools auf einmal öffnen können, diese sind schon im installationsverzeichnis mit drin. wie schreibe ich aber nun das delphi die jeweilige exe öffnet? ohne absoluten pfad!

ausblenden volle Höhe 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:
30:
31:
32:
33:
head [...]

procedure TForm1.Button7Click(Sender: TObject);
begin
close;
end;

procedure TForm1.Button5Click(Sender: TObject);
begin
ShellExecute(Application.Handle, 'open', '\icq\setup.exe', nil, nil, SW_SHOW);
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
 ShellExecute(Application.Handle, 'open', '\teamspeak server\server_windows.exe', nil, nil, SW_SHOW);
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
 ShellExecute(Application.Handle, 'open', '\teamspeak client\TeamSpeak.exe', nil, nil, SW_SHOW);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
ShellExecute(Application.Handle, 'open', '\atc\atcbf2.exe', nil, nil, SW_SHOW);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
ShellExecute(Application.Handle, 'open', '\icq\setup.exe', nil, nil, SW_SHOW);
end;

end.


das war meine Idee, das wie bei html oder so zu machen, aber funzt ja nich, wie muss ich das nun schreiben, da ich mich ja nicht an z.b. C:\\Programme\Tools\atc\atcbf2.exe" halten will. Kann ma nicht schreiben wenn die exe in wie oben prog\tools liegt das einfach der nächste unterordner "atc" geöffnet wird?

Ich hoffe ihr versteht mein Problem!
Thx und Cyu!!!

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: So 09.07.06 13:23 
Mit 'ExtractFilePath(ParamStr(0))' bekommst du das Programmverzeichnis der Exe.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Death666Metal Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 22

Win XP
Delphi 7/html/php/flash/basic/c++
BeitragVerfasst: So 09.07.06 19:52 
Wie meist du das?

Soll ich das bei ShellExecute[...] eifügen oder wie soll das eingebunden werden?
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: So 09.07.06 19:55 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.Button5Click(Sender: TObject);
begin
ShellExecute(Application.Handle, 'open', extractfilepath(paramstr(0))+'icq\setup.exe', nil, nil, SW_SHOW);
end;

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Death666Metal Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 22

Win XP
Delphi 7/html/php/flash/basic/c++
BeitragVerfasst: Mo 10.07.06 13:15 
Alles klar, danke