How can I kill a process which is started by ShellExecute() in Delphi 7. When clicking a button a java app开发者_如何学JAVAlication is opened. It works perfectly. I need to close the process by clicking another button. How can I terminate the java application from delphi?
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
.
精彩评论