Get region of a pop-up window

Asked by Steffen

Hello, when I run any application (for example Firefox) and within this application a pop-up windows appears (for example a advertisement pop-up) - is it possible to get the region of this pop-up window?

My goal is to take a screenshot of this pop-up window (NOT the whole screen). I already have a function which can do a screenshot of a region - but only if I know the region.

Edit: You can assume that the pop-up window has the focus.

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
j (j-the-k) said :
#1

You'll have to search for a part of the popup that only exists in the popup window. If this part is found, you can calculate the whole popup region, assuming the window has always the same size.

Revision history for this message
Steffen (steffen-be) said :
#2

Sorry, I forgot to mention something:
It's not one pop-up window but many of them I want to take a screenshot of...
So your answer is possible, but this would be a lot of work for me to do this for all of these expected windows.
I thought there could be another way to get region (or at least height and width) of an active pop-up window.
But thank you for your response!

Can you help with this problem?

Provide an answer of your own, or ask Steffen for more information if necessary.

To post a message you must log in.