anyone knows how to get the active windows (OS native, not inside java app) using java ? I saw that RFT has a way of doing it
eg. IWindow activeWin = RationalTestScript.getScreen().getActiveWindow();
so I wondering what is the deal behind it ? is there any other method of doing it easier ? thanks
As far as I know, there is no way in the JDK – I imagine RationalTestScript is using native code behind the scenes.
Consdier this: if there were a method in the JDK to get the native active window – what would it return? A
java.awt.Windowwould not work, since that is a window specifically under java control.You may have some success with JNA, which provides native access to the window handle, but you just get a pointer/integer. You will then have to call OS functions to do anything useful with that. I expect RTS is doing this behind the IWindow interface.