Which window is on top?

I’ve got 5 windows in an application. I want to select which windows are visible from a menu. That works, more or less. I just toggle window visibility from the menu, and check the item if visible, uncheck if not. But it is kind of a bother when the window of interest is visible, but covered by another window. Then If an already-visible window is not at the top of the pile, then I want it brought to the top. But I don’t see a Window property to indicate which window has focus.

Can anyone tell me how to go about ascertaining whether a window is the top window?

window(0) is top window.

Take a look at this:
Window Method LR Link

Thanks Christian. That did it. Here is the function that responds to the menu item events (with window and item as args)

If wnd.visible And wnd = Window(0) Then

wnd.Hide
item.checked = False

Else
wnd.Show
item.checked = True
End If