Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to close an EXE gracefully (Ed Rauh's class)
Message
From
18/04/2007 09:29:32
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01217197
Message ID:
01217265
Views:
39
I would use a semiphore file to signal the other app to close. I would use a timer in the Application object which would check for the presence of this file and when "seen" would gracefully shut down itself.
The exe which spawns this external exe when shutting down should place the token file in a "visible" directory.

Glenn


>My main application starts a second exe that remains running all the time.
>When the main application closes, the secondary exe should close automatically. Is there an elegant way to do this?
>
>
>I have used Ed Rauh class (File #9477) to launch the secondary FoxPro exe. It can be closed with his KillProc(), which runs TerminateProcess. That works, but Ed had a note in his class that says this does not shut down in an orderly fashion; it should only be used for emergencies!
>
>So the question is: how does one close the secondary exe in an orderly fashion?
>
>Cyril
Previous
Reply
Map
View

Click here to load this message in the networking platform