Hello Doug L,

Regarding your Z order question... Can you give me a specific example what you are needing this for? Maybe that would help us give you a better idea of what you can currently do or something we could add in the future.

Thanks,
Doug G

On 11/22/2010 3:33 PM, Doug Lee wrote:
We're looking for a reliable way to get the next and previous window
in Z order from a given window.  It might sometimes also be useful
to get the first and last window in Z order at the given window's
tree level.  The Windows API GetWindow() function allows this sort
of query, and there are WinAPI functions for next and prior window,
but I don't see a direct way to do it in Window-Eyes.  I'm betting
I missed something obvious.

My two ideas are

' Given window, the one to start from ...
dim nextWindow, priorWindow
' Idea 1.
set nextWindow = window.control.next.window
set priorWindow = window.control.previous.window
' Idea 2.
dim windows : set windows = window.parent.directChildren
dim i
for i = 1 to windows.count
        if windows(i).handle = window.handle then
                set nextWindow = windows(i+1)
                set priorWindow = windows(i-1)
        end if
next

Plus error checking of course.

But I don't know if control.next/previous or directChildren sort by Z
order, so I'm not sure if one approach is more accurate than the other.
I'm also assuming that window.control is always valid for all Window
objects here.

Is there a better way of doing this, and if not, is the
window.control.next/previous.window method the preferred way of doing it?


Reply via email to