| Autor |
Beitrag |
Death666Metal
      
Beiträge: 22
Win XP
Delphi 7/html/php/flash/basic/c++
|
Verfasst: 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!
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 raziel: Code- durch Delphi-Tags ersetzt
|
|
Marco D.
      
Beiträge: 2750
Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
|
Verfasst: 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 
      
Beiträge: 22
Win XP
Delphi 7/html/php/flash/basic/c++
|
Verfasst: 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.
      
Beiträge: 2750
Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
|
Verfasst: So 09.07.06 19:55
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 
      
Beiträge: 22
Win XP
Delphi 7/html/php/flash/basic/c++
|
Verfasst: Mo 10.07.06 13:15
|
|
|