Autor Beitrag
Termi11
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 20



BeitragVerfasst: Di 14.08.07 23:55 
Hallo,

hab ein "Problem" mit Shellexecute.

Das Starten einer Dos Applikation geht ohne Probleme.

Leider hab ich zb. 2 oder mehr gleiche Dos Programme die ich starten muss, und in bestimmten Fällen einzeln gestoppt werden müssen.

Besteht die Möglichkeit die Processid der einzelnen Dos Programme abzufragen?

Besten Dank im Voraus!!
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 15.08.07 03:32 
Warum nimmst du nicht einfach CreateProcess statt ShellExecute? Da bekommst du die doch direkt.
Termi11 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 20



BeitragVerfasst: Fr 17.08.07 17:52 
Hab dies Probiert, geht auch wunderbar!
Besten Dank

Jetzt versuche ich die Ausgabe, welche vom Dos Tool kommt, aufzufangen, hab hier auch schon viel über "GetConsoleOutput" gelesen, dort wird mit Pipes usw. gearbeitet.
Wie ich dies sehe/verstehe, wird die Dos Applikation abgearbeitet, und die Ausgabe dann angezeigt im Win Frame.

Nur wie sieht das aus bei Dos Programmen, welche dauernd weiter laufen wie zb. "ping -t 192.168.1.1" !?
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: So 19.08.07 15:59 
Das schöne an Pipes ist, doch, dass man sie fortlaufend lesen kann. Man muss nur schauen, ob neue Daten angekommen sind.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Termi11 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 20



BeitragVerfasst: So 19.08.07 17:43 
Klingt soweit noch ok ;-) Nur frag ich mich, wie ich dies anstellen soll...Mit nem Timer, zb. jede Sekunde checken.
Doch nehme ich an, dass es da bessere Methoden gibt. Sorry, bin noch neu beim Thema Delphi.
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: So 19.08.07 20:47 
Mit nem Timer geht das nicht. Es gibt eine Komponente TDosCommand, die ein Event auslöst, sobald eine weitere Ausgabe vom Konsolenprogramm kommt.