View Full Version : Kill a process


TylerTand
06-16-2008, 05:12 PM
I have a command button that opens up two programs and when I am done with the current form and it closes I would like to close both the programs that the button started. I have tried Application.name.quit and variations of that but it doesn't seem to work. Is there a quick way to name the .exe file and end it? Your help is appreciated.
Tyler

DJkarl
06-17-2008, 08:07 AM
You need to get the handle to the application and then you can use either the PostMessage API or the EndTask API.

If the method you are using to run the applications does not give you the handle to the app, use the FindWindow API to get the handle.