← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #664182]: How to Get the PID or name of focused App?

 

Question #664182 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/664182

Description changed to:
Hi everyone.

I'm learning sikuli now and need some help.

I'm using sikulixapi for Java.

I Need to get the App that is in focus and listen when the user change
the focus to another app.

I'm trying this way:

while(true){
     App.focusedWindow();
}

This way, i get the Region of app in focus, and when the user changes, i
get the new Region.

But there is a way to get the App instance by a Region?

In my project, i have to learn some data from app in screen by OCR,
process and save this data by App instance. I will show the result to
the user on screen when he focus the App again.

User can manage many instances of the App, with the same visual. (Like
many Untitled Notepads). I have to do something to identify wich
instance is in focus (like PID) and show the correct information
processed before.

Some idea?

Thanks

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.