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?
Share
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 byShellExecute. Once you have that you simply callTerminateProcess. As yet another alternative, you may consider creating the process withCreateProcess.