Just to add to my reply.  This may help after the CreateProcess function.
 
repeat
  Application.ProcessMessages;
  WaitForSingleObject(ProcessInfo.hProcess,100);
  GetExitCodeProcess(ProcessInfo.hProcess,ExitCode);
until ExitCode <> STILL_ACTIVE
 
Ross.
----- Original Message -----
From: Ross Levis
Sent: Thursday, June 03, 2004 5:07 PM
Subject: Re: [DUG] Keeping a handle on running app

Use WaitForSingleObject but you need the handle from CreateProcess.  The handles are stored in the TProcessInformation structure.
 
Regards,
Ross.
----- Original Message -----
Sent: Thursday, June 03, 2004 4:45 PM
Subject: [DUG] Keeping a handle on running app


Hi

Does anyone know a way to run an application (easy enough) but to also keep a handle to the application and know when it finishes. Using D7 and have been trying 'mutexes' and 'waitforsingleobject' with no luck so far.

Regards

Robert Wilson
Software Developer

Cellular Cellnet (NZ) Limited
_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to