Autor Beitrag
BL!ZZARD
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 19

Win XP Professional

BeitragVerfasst: Mo 23.01.06 20:45 
Hallo,

Ich will in Delphi bei einem Buttonklick eine EXE-Datei öffnen, habe aber leider nirgens was gefunden, wie ich das wieder anstellen soll.

Und da ihr hier alle Profis seid, dachte ich mir, ich frage mal euch.


Danke schonmal !


Gruß, der BL!ZZARD

_________________
Eine Freundschaft die nur aus Lügen besteht, stirbt an der ersten Wahrheit !
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mo 23.01.06 20:52 
Das Zauberwort ist Suche in der Entwickler-Ecke SHELLEXECUTE. ;-)

_________________
We are, we were and will not be.
BL!ZZARD Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 19

Win XP Professional

BeitragVerfasst: Mo 23.01.06 20:54 
user profile iconGausi hat folgendes geschrieben:
Das Zauberwort ist Suche in der Entwickler-Ecke SHELLEXECUTE. ;-)


Da dann den kompletten Pfad der EXE Datei eingeben ?

_________________
Eine Freundschaft die nur aus Lügen besteht, stirbt an der ersten Wahrheit !
Alstar
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 827



BeitragVerfasst: Mo 23.01.06 20:56 
LLCoolDave
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 212

Win XP
Delphi 2005
BeitragVerfasst: Mo 23.01.06 20:57 
ShellExecute sollte dir da weiterhelfen.

ausblenden Delphi-Quelltext
1:
ShellExecute(Application.Handle,'open',*DateiName*,nil,*Pfad in dem die Datei ausgeführt werden soll*,sw_ShowNormal);					


Wenn du Dateiname oder Pfad als string übergibst setz noch nen PChar() drum, also z.B:

ausblenden Delphi-Quelltext
1:
ShellExecute(Application.Handle,'open',PChar(ExtractFileName(edit1.text)),nil,PChar(ExtractFilePath(edit1.text)),sw_ShowNormal);					


Wenn der Pfad + Dateiname in Edit1 stehen.

Achja, ShellAPI bei uses hinzufügen.