Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   C# Execute and Wait (https://www.delphipraxis.net/57836-execute-wait.html)

phXql 27. Nov 2005 13:29


Execute and Wait
 
Moin Leute... folgendes problem:

Ich möchte eine Anwendung ausfhren lassen, und erst weitermachen, wenn diese beendet wurde. Unter Win32 Delphi gibts das hier ja schon oft, aber ich bräuchte es unter .NET. Am besten wenns geht ohne PInvokes... Danke!

mfg phXql

phXql 29. Nov 2005 19:07

Re: Execute and Wait
 
Manchmal macht es einem Microsoft echt leicht. Anstatt mit WaitForSingleObject rumhantieren zu müssen, muss man nur WaitForExit() des Prozesses aufrufen! :thumb:

Lösung:
Code:
System.Diagostics.Process p = System.Diagnostics.Process.Start("calc.exe");
Console.WriteLine("Calc gestartet!");
p.WaitForExit();
Console.WriteLine("Calc beendet!");


Alle Zeitangaben in WEZ +1. Es ist jetzt 08:13 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz