Detecting the Edge of the Screen

Asked by pipboy

Hi,I am running a for-loop ,
in this loop,script have to execute a program and auto-click [Yes button] of the [Warning window]
this [Warning window] will move his position to down gradually when loop run once again
if warning touch edge of the Screen and behind Win7 toolbar,
in this time, sikuli cannot detect [warning windows] well .
so i want to ask,is there a way to solve this situation,
or keeping specific window always on the screen?

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

--- move warning window
Test this manually: If you move the warning window slightly to top-left will the next warning window open based on the position of the window, you just moved before or will it ignore the movement and constantly step right-down?
If it does not ignore:
Just drag and drop the window slightly top-left, before clicking "yes". This should keep it in place.

--- if above does not work
take the position/dimension of the match of the warning window and compare them to the screen dimensions:
m = getLastMatch() # after finding warning window
if m.y+m.h > getBounds().h-50: print "going to be hidden next time"

Revision history for this message
pipboy (peace03) said :
#2

The first method is OK
you point out my blind spot
thanks

Revision history for this message
pipboy (peace03) said :
#3

Thanks RaiMan, that solved my question.