How can we close IE window through Java?
1 posts in topic
Flat View  Flat View

Posted By:   Anonymous
Posted On:   Thursday, May 27, 2004 03:40 AM

Hi All,

Is there any core method available in Java to close the IE window? or do we need some native method? I know it can be easly done by JavaScript. but i need some way in core java so that i can call it from jython.

waiting for an early response.


Re: How can we close IE window through Java?

Posted By:   Jens_Dibbern  
Posted On:   Sunday, May 30, 2004 01:30 PM

Hi Asim,

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.


About | Sitemap | Contact