When you start those other applications (say, using ShellExecuteEx), you can
obtain the process handle.  By testing for the signalled state of the
process handle, you can tell if the other app has closed down.  A process is
complete when its state is signalled.  Use either WaitForMultipleObjects /
WaitForSingleObject WinAPI call.

Regards,
Dennis.

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Patrick Dunford
> Sent: Tuesday, 18 January 2000 23:16
> To: Multiple recipients of list delphi
> Subject: [DUG]: FWD: Closing Other Applications
>
>
>
>
> This message is forwarded from the newsgroup
> "borland.public.delphi.winapi".
>
> ----------- Begin Forwarded Message -----------
>
> Subject: Closing Other Applications
> From: Patrick Dunford <[EMAIL PROTECTED]>
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I have an application that launches other applications. I
> want it to be able
> to close these other applications when it closes, and I want
> to know if the
> other applications have closed.
>
> The following code is fine for closing another application
>
>      THnd:=FindWindow(PChar('TMainForm'),PChar('Staff Data Entry'));
>      SendMessage(THnd,WM_CLOSE,0,0);
>
> But I want to know if the application's window failed to
> close (perhaps
> because of an error). Another FindWindow statement
> immediately following
> says
> the window is still there even if it has been successfully closed.
>
> - --
> Messages to http://patrick.dunford.com/message.htm
> PGP Key available from ldap://certserver.pgp.com/
> Home page http://patrick.dunford.com/
>
> -----BEGIN PGP SIGNATURE-----
> Version: PGPfreeware 6.0.2i
>
> iQA/AwUBOIOScATDOUeLQzcDEQLScQCeOUNb/zCgWLOLh8ku9mImF4KCFH0AoKZi
> Qs/LI8thw8kJ3ClYOrh+Tmsg
> =hQmT
> -----END PGP SIGNATURE-----
>
> --------------------------------------------------------------
> -------------
>     New Zealand Delphi Users group - Delphi List -
> [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
>

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to