Link to home
Start Free TrialLog in
Avatar of Erik N
Erik N

asked on

´"Stop" motherapp. after launching with Createprocess..

I use Createprocess to launch an external application. However, I want the "Mother-process" (the app. that I use to Launch) to execute some lines of code after the launched application is closed..

Like this:

Procedure Form1.Button1Click(Sender: TObject);
// Var declaration..
Begin
Createprocess(PChar(Process_To_Launch),NIL,NIL,NIL,False,
Normal_Priority_Class,NIL,Startup_Info,Process_Info);

// some lines of code that I want to be executed after the
// Process_To_Launch is closed down.
// For example:

ShowMessage('The Process is closed down');

End;

The problem is that the external application is launched,
and then the following rows of code is executed directly,
Without waiting for the launched application to finish..

Is this the way to do it, or do I have to create some event-
handling for this, in short: How do I do it?

I use Delphi Developer 2.0
Thanks!
Erik N
Avatar of Erik N
Erik N

ASKER

Edited text of question
Avatar of Erik N

ASKER

Edited text of question
ASKER CERTIFIED SOLUTION
Avatar of inter
inter
Flag of Türkiye image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Erik N

ASKER

It worked just fine!
Thank you Inter-Igor!

Erik N