Autor Beitrag
CinimoD
Hält's aus hier
Beiträge: 8

Win XP
Delphi 7
BeitragVerfasst: So 06.03.05 16:58 
Hallo erstmal!
Erstmal muss ich sagen dass ich ein Anfänger bin und mich erst seid einem halben jahr mit delphi beschäftige. Ich möchte bloß mal wissen wie man auf eine externe exe Datei zugreifen kann. Es währe nett wenn mir jemnad mal ein Sourcbeispiel gebn könnte.

Thx im vorraus.
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: So 06.03.05 17:01 
Auch hallo :welcome:

Was willst du denn von der Datei wissen? Oder willst du sie ausführen?
CinimoD Threadstarter
Hält's aus hier
Beiträge: 8

Win XP
Delphi 7
BeitragVerfasst: So 06.03.05 17:04 
ausführen möchte ich die datei!
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: So 06.03.05 17:07 
Dann sieh dir die Delphi-Online-Hilfe (gemeinhin im Forum OH genannt) zu ShellExecute and oder gib den Begriff in der Suchfunktion ein. Da ist schon ziemlich viel zu geschrieben worden.
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: So 06.03.05 17:09 
ausblenden Delphi-Quelltext
1:
Uses ..., ShellAPI;					

Dann kannst du mit dem Befehl ShellExecute eine Datei ausführen.
Suche in: Delphi-Forum, Delphi-Library SHELLEXECUTE
msdn.microsoft.com/l...ons/shellexecute.asp
PLuS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 98

Win XP, Suse Linux 9.0
D5 Standard, D2005 Personal; Perl; PureBasic
BeitragVerfasst: So 06.03.05 17:10 
Dann musst du die exe per ShellExecute ausführen!

ausblenden Delphi-Quelltext
1:
ShellExecute(Handle,'open',pChar('Deine.exe'), '', '', SW_SHOWMAXIMIZED);					


Anstatt von Deine.exe einfach Dateinamen ersetzen!

Die uses-Klausel musst du dann nur noch um "ShellAPI, ShellCtrls" erweitern!
CinimoD Threadstarter
Hält's aus hier
Beiträge: 8

Win XP
Delphi 7
BeitragVerfasst: So 06.03.05 17:31 
Thx für die Antworten also, ich bin jetzt so weit:
ausblenden Delphi-Quelltext
1:
2:
pfad := ExtractFilePath(Application.ExeName);
WinExec('1.exe',SW_SHOWNORMAL);


Und ich möchte jetzt dass ich auf eine datei zugreife die in einem unterordner von meinem projekt ist. und die soll immer ausgeführt werden wenn ich auf einen button klicke. Und es ist egal wo sich dieser ordner befindet nur der unterordner soll so bleiben wie er ist.
CinimoD Threadstarter
Hält's aus hier
Beiträge: 8

Win XP
Delphi 7
BeitragVerfasst: So 06.03.05 18:43 
Warum antwortet mir keiner mehr?? Bitte helft mir!!!!

PS: sry wegen doppelpost!!!
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: So 06.03.05 18:54 
ausblenden Delphi-Quelltext
1:
2:
pfad := ExtractFilePath(paramstr(0));
WinExec(pfad + 'unterordner von meinem projekt\1.exe',SW_SHOWNORMAL);

also so ? ;)

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
PLuS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 98

Win XP, Suse Linux 9.0
D5 Standard, D2005 Personal; Perl; PureBasic
BeitragVerfasst: So 06.03.05 18:56 
Dann mach doch einfach:
ausblenden Delphi-Quelltext
1:
ShellExecute(Handle,'open',pChar(pfad+'/Unterorder/Deine.exe'), '', '', SW_SHOWMAXIMIZED);					
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: So 06.03.05 19:00 
PLuS hat folgendes geschrieben:
Dann mach doch einfach:
ausblenden Delphi-Quelltext
1:
ShellExecute(Handle,'open',pChar(pfad+'/Unterorder/Deine.exe'), '', '', SW_SHOWMAXIMIZED);					

seit wann spricht man das dateisystems eines dos-basierenden pcs mit nem normalen slash an ? :gruebel:

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
PLuS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 98

Win XP, Suse Linux 9.0
D5 Standard, D2005 Personal; Perl; PureBasic
BeitragVerfasst: So 06.03.05 19:03 
Upsala! :oops:
Ich wars nich! dumdidum
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: So 06.03.05 19:05 
hrhrhr :twisted:

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...