I have a program that can send input to a running application. But if sometimes any erroneous input is given the program exits or loses focus. I just want to know if I can detect the current activity that is on focus and compare it with my programs activity to learn whether the desired program lost focus or not. The program i am testing is a third party application. So i cannot write the program myself. All i need to know is to learn the current running activity with focus. The tool I am using to send commands is written in ruby and java. Do you have any java program to query about this?
Thanks.