New question #169784 on Sikuli:
https://answers.launchpad.net/sikuli/+question/169784

Hi,

I have written a piece of code to get in global variable the active window 
region using the App object.


def alaloopGetActiveWindow(wmin, hmin, imgTitle=None):
        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=alaloopSelectRegion("TOP", 50, 0, appWindow)
                        if not reg.exists(imgTitle, 0): continue
                        
                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


-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp

Reply via email to