Autor Beitrag
stratege15
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 58



BeitragVerfasst: Sa 12.06.04 20:30 
hallo,
wie kann man eine externe exe-datei ausführen, und die parameter auslesen, die dieses programm zurückgibt (dos-programm)?
NetZwerg
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 448

Slackware 10.1
Kylix 3, D5 Standard
BeitragVerfasst: Sa 12.06.04 20:36 
mit ShellExecute ausführen, parameter denkich ma irgendwas mit API, aber da fragste am besten wen anders :mrgreen:

_________________
"Manche Leute drücken nur deshalb ein Auge zu, damit sie besser zielen können."
Billy Wilder, amer. Filmregisseur
hallo
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 450

WIN XP, SuSE 9.3
D3 Prof, D6 Pers, 2005 Pers
BeitragVerfasst: So 13.06.04 11:44 
Einfach so:
ausblenden Quelltext
1:
uses ...,shellapi					

ausblenden Quelltext
1:
ShellExecute(handle,'open','Programm.exe','','',sw_normal);					

Für Programm.exe musst du dann das angeben was geöffnet werden soll.
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: So 13.06.04 11:54 
Ich nehm an mit "Parameter" meinst du die Textausgabe eines Dos-Programmes. Dazu gibts mehrere Möglichkeiten, u.a.:
- eine Möglichkeit von Luckie hier
- die Komponente DosCommand

raziel

_________________
JSXGraph
FAlter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 192

Win XP Home
Turbo Delphi 2006 (Win32), C# (VS 2008 Prof.), Java (Eclipse), PHP
BeitragVerfasst: So 13.06.04 12:14 
raziel hat folgendes geschrieben:
Ich nehm an mit "Parameter" meinst du die Textausgabe eines Dos-Programmes.


Denke ich nicht.

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
...
  ; Int 21h, Funktion 4Ch
  ;Beendet Programm mit Rückgabewertr in al
  mov ah, 4C00h ;ah = 4Ch; al = Rückgabewert = 00h = 0
  int 21h

  mov ah, 4C01h ;Rückgabewert 1
  int 21h


Er meint also das, was beim Aufrufen der Funktion 4C des DOS-Interrupts 33 ($21) im Register al steht.
MathiasSimmack
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 13.06.04 12:31 
So sicher wäre ich da nicht. Die Frage ist in dem Punkt so schwammig formuliert, da könnte jeder von euch richtig liegen. Solange stratege15 nicht deutlicher wird, lohnt es sich IMHO auch nicht, weiter darüber nachzudenken.
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: So 13.06.04 12:35 
Kann auch sein...
Aber auch da kann dem Manne geholfen werden:
Im Code von Luckie (siehe oben) sind nämlich zwei interessante Zeilen drinne:
Luckie hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
2:
        WaitForSingleObject(procInfo.hProcess, Infinite);
        GetExitCodeProcess(procInfo.hProcess, return);

Laut Win32 SDK liefert GetExitCodeProcess uns folgendes:
Win32 SDK hat folgendes geschrieben:
f the specified process has not terminated, the termination status returned is STILL_ACTIVE. If the process has terminated, the termination status returned may be one of the following:

· The exit value specified in the ExitProcess or TerminateProcess function.
· The return value from the main or WinMain function of the process.
· The exception value for an unhandled exception that caused the process to terminate.



raziel

_________________
JSXGraph