Subject: RE: [DUG]: Process termination
From: "Dennis Chuah" <[email-masked]>
To: Multiple recipients of list delphi <[email-masked]>
Date: Wed, 16 May 2001 13:50:36 +1200

A success from GetExitCodeProcess does not always guarantee that NT is done
with the process' resources.  For example, NT may still keep the EXE file
locked for a short while.

BTW, a better function to use is WaitForSingleObject /
WaitForSingleObjectEx.  Pass in the process handle.  The object is signalled
when the process is terminated.

Regards,
Dennis.

> -----Original Message-----
> From: [email-masked] [mailto:[email-masked]]
> Sent: Wednesday, 16 May 2001 11:27
> To: Multiple recipients of list delphi
> Subject: [DUG]: Process termination
>
>
> Hi All
>
> When a Process is terminating and you are waiting for the process
> to complete
> its Termination, i.e. waiting on GetExitCodeProcess <> STILL_ACTIVE.
> Does anyone know if there is a temporary state ("error code") returned by
> GetExitCodeProcess, between STILL_ACTIVE and the Process Termination fully
> Completed.
> Something like "Terminating" ???
>
> What we are doing is running the process, waiting for it to
> terminate, and then
> closing the handles for the Thread and Process, and deleting the EXE.
> Every now and then the close handle fails (The GetExitCodeProcess
> succeeds) and
> the delete fails.
>
> any help much appreciated...
>
>
> Regards
> Paul McKenzie
>
> =========================
> Paul McKenzie
> Jetbet II Developer
> =========================
> [email-masked]
> Ph: (04) 576-6822
>
> T.A.B. National Office
> 106-110 Jackson Street
> Petone
> New Zealand
>
>
>
> ------------------------------------------------------------------
> ---------
>     New Zealand Delphi Users group - Delphi List - [email-masked]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [email-masked]
> with body of "unsubscribe delphi"

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [email-masked]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [email-masked] 
with body of "unsubscribe delphi"