Autor Beitrag
mcondoi
Hält's aus hier
Beiträge: 15

Win XP
Delphi 2005
BeitragVerfasst: Sa 11.08.07 12:55 
Wie lasse ich bei Klick auf einen Button eine .exe datei starten? Wie geht das?
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Sa 11.08.07 13:00 

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
mcondoi Threadstarter
Hält's aus hier
Beiträge: 15

Win XP
Delphi 2005
BeitragVerfasst: Sa 11.08.07 13:01 
Beispiel, bitte? :flehan:
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Sa 11.08.07 13:12 
Wenn du dem Link folgst wirst du genau Bespiele finden.
Ansonsten möchte ich dir die Suchfunktion des Forums ans Herz legen. Wenn du einfach nach Suche in: Delphi-Forum EXE AUSFÜHREN oder Suche in: Delphi-Forum PROGRAMM STARTEN suchen würdest, hättest du deine Lösung schon gefunden.

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Jakob_Ullmann
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1747
Erhaltene Danke: 15

Win 7, *Ubuntu GNU/Linux*
*Anjuta* (C, C++, Python), Geany (Vala), Lazarus (Pascal), Eclipse (Java)
BeitragVerfasst: Sa 11.08.07 18:35 
ausblenden Delphi-Quelltext
1:
2:
3:
begin
  ShellExecute(Handle,nil,PChar('D:\Programme\Firma\Programm\das_programm.exe'),nil,nil,SW_SHOW);
end;

Bei ShellExecute kannst du JEDE Dateikennung angeben, sogar eine URL.
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Sa 11.08.07 20:15 
um gleich der unvermeidlichen Frage vorzugreifen:
Du musst noch ShellApiin der usesKlausel einfügen.

_________________
In the beginning was the word.
And the word was content-type: text/plain.
mcondoi Threadstarter
Hält's aus hier
Beiträge: 15

Win XP
Delphi 2005
BeitragVerfasst: So 12.08.07 12:33 
Danke! Jetzt ist mein Problem gelöst, und meine Frage beantwortet. :wink: :flehan:
X-Delphi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29



BeitragVerfasst: Mi 29.08.07 16:34 
Titel: Antwort
Füge diesen Text in die Ereignisprozedur des Buttons ein;
In der Uses Klausel must du ShellApi einbinden;


ausblenden Delphi-Quelltext
1:
2:
3:
if (ShellExecute(Application.Handle, 'open', Pchar
('C:/Programmpfad), Nil, Nil, SW_NORMAL) <= 32) then
    ShowMessage('
Es ist ein Fehler aufgetreten');


Wenn dies Datei nicht vorhanden ist wird eine Nachricht angezeigt;

Moderiert von user profile iconmatze: Delphi-Tags hinzugefügt
Jakob_Ullmann
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1747
Erhaltene Danke: 15

Win 7, *Ubuntu GNU/Linux*
*Anjuta* (C, C++, Python), Geany (Vala), Lazarus (Pascal), Eclipse (Java)
BeitragVerfasst: Mi 29.08.07 16:51 
Also irgendwie ist einem doch schon da, wo er das Wort Shell (ShellExecute) ließt, klar, dass er die shellapi einbinden muss. Auf jeden Fall würde ich's versuchen.
Wolle92
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Mi 29.08.07 18:56 
Anfänger wissen nicht unbedingt, dass es ShelLAPI überhaupt gibt