Autor Beitrag
Spatz
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57

WIN 2k
D7E
BeitragVerfasst: Fr 11.03.05 14:01 
Wie kann ich ein Programm aus meinem Konsolenprogramm starten?
bei shellexecute benötigt man ein handle (das ich bei einem konsolenprogramm nicht habe) und wenn ich 0 angebe, so erstellt es mir zwar ein prozess, zeigt das programm aber nicht an...

besten dank
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Fr 11.03.05 14:05 
user profile iconSpatz hat folgendes geschrieben:
Wie kann ich ein Programm aus meinem Konsolenprogramm starten?
bei shellexecute benötigt man ein handle (das ich bei einem konsolenprogramm nicht habe) und wenn ich 0 angebe, so erstellt es mir zwar ein prozess, zeigt das programm aber nicht an...

besten dank


Wie sieht dein Aufruf aus?

AXMD
Timosch
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1314

Debian Squeeze, Win 7 Prof.
D7 Pers
BeitragVerfasst: Fr 11.03.05 14:13 
Wenn's nur ein Programm seien soll:
ausblenden Delphi-Quelltext
1:
WinExec(Programmname : PChar, Anzeigemodus : Integer): Integer;					

Ich weiß, das ist veraltet. ABER DAS IST MIR EGAL! In der Win-API von XP/2003 ist es jedenfalls immer noch drin.

_________________
If liberty means anything at all, it means the right to tell people what they do not want to hear. - George Orwell
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Fr 11.03.05 14:15 
Was mit WinExec geht, muss mit ShellExecute auch gehen... der letzte Parameter deines Aufrufs wäre interessant zu wissen.

AXMD
Spatz Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57

WIN 2k
D7E
BeitragVerfasst: Fr 11.03.05 14:18 
mein aufruf: ShellExecute(0, 'open', 'c:\test.exe', nil, nil, SW_SHOW);
wenn ich diesen aufruf in einem normalen programm (mit einer form) ausführe, dann erfolgt das gewünschte ergebnis...

winexec habe ich ebenfalls schon probiert => funktioniert auch nicht :S
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Fr 11.03.05 14:24 
user profile iconSpatz hat folgendes geschrieben:
winexec habe ich ebenfalls schon probiert => funktioniert auch nicht :S


Also das kann ich mir beim besten Willen nicht vorstellen. Bist du sicher, dass C:\test.exe existiert?

AXMD
Spatz Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57

WIN 2k
D7E
BeitragVerfasst: Fr 11.03.05 14:25 
user profile iconSpatz hat folgendes geschrieben:

wenn ich diesen aufruf in einem normalen programm (mit einer form) ausführe, dann erfolgt das gewünschte ergebnis...

Es ist der genau gleiche aufruf!
Spatz Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57

WIN 2k
D7E
BeitragVerfasst: Fr 11.03.05 15:18 
ah, ganz vergessen zu sagen: mein programm läuft als dienst. wenn ich aus einem sonstigen konsolenprogramm ein programm starte, dann funktioniert das ganz gut.
hat mir irgent jemand eine möglichkeit (oder idee), wie ich ein programm sonst noch starten könnte?
Timosch
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1314

Debian Squeeze, Win 7 Prof.
D7 Pers
BeitragVerfasst: Sa 12.03.05 11:36 

_________________
If liberty means anything at all, it means the right to tell people what they do not want to hear. - George Orwell