How to get an instance of Internet Explorer from java?

601 views Asked by At

I have a java 6 application, and i need to get a determined instance of internet explorer from java?. This instance of IE it is running in the same pc that JVM. When i get the instance, i need to change the url.

Anybody has any idea about this?

I searched in google, and i found some related with this. I think, I need to install something from microsoft for to use this package. It is valid for windows XP and Java 6? I found the page https://support.microsoft.com/en-us/kb/299356.

I found JNA, and i have a pice of code, where i can get a handler of a User32 instance. But i donĀ“t know how i can navigate to an URL.

public static void main(String[] args) {
    HWND hwnd = User32.INSTANCE.FindWindow
           (null, "PageTitle"); // window title
    if (hwnd == null) {
        System.out.println("Excel is not running");
    }
    else{
        User32.INSTANCE.ShowWindow(hwnd, 9 );        // SW_RESTORE
        User32.INSTANCE.SetForegroundWindow(hwnd);   // bring to front

    }
}
0

There are 0 answers