1

How can I kill a process which is started by ShellExecute() in Delphi 7. When clicking a button a java application is opened. It works perfectly. I need to close the process by clicking another button. How can I terminate the java application from delphi?

3

1 Answer 1

5

In this case you would be better to use ShellExecuteEx() to start the process. This allows you to obtain the newly created process handle which is not returned by ShellExecute. Once you have that you simply call TerminateProcess. As yet another alternative, you may consider creating the process with CreateProcess.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.