Re: How can we close IE window through Java?
Sunday, May 30, 2004 01:30 PM
do you start the IE before by Runtime.exec(...)? In this case you can stop the process object with the destroy method. If you want to stop any running windows process, you must know its process id. You can stop it by OpenProcess (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/openprocess.asp) and TerminateProcess. If you don't know the id you can find it with EnumProcesses and GetModuleFileNameEx, but it's not very smart to kill any iexplore.exe process.