App object with Windows 7
Hi,
I have written a piece of code to get in global variable the active window region using the App object.
def alaloopGetActiv
global app, appWindow
# get the visible application window
appWindow=None
for i in range(100):
appWindow = app.window(i)
if not appWindow: break
log("Get window %i at %i-%i with w=%i - h=%i" % (i, appWindow.x, appWindow.y, appWindow.w, appWindow.h))
if (appWindow.w < wmin or appWindow.h < hmin): continue
# check for image in title
if imgTitle is not None:
reg=
if not reg.exists(
log("The Window match !")
break
if not(appWindow) or appWindow is None:
popup("Unable to find the active window of application")
return
It works fine on Windows XP SP2. For example with Notepad++, it's easy to get the main window, or the "open file" window or the "search" window.
But the same script on a Windows 7 can't find anything else than some 0 sized windows.
Do you know anything about such a trouble ?
Thank you for your help,
Sylvain Caillet
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: