Brian Heibert wrote:
How do I find out what is the currently on top (open) window for
example say I have window 1 and window 2 and window 1 was on top
how do I find out that it is indeed window 1 on top

so I can close that window if Close Window was selected in my file menu

First you can implement the menu handler directly in your window.

Second, if you can't do the first solution for some reason, you
can use the following code to get the top window.

Function getTopWindow(windowType as integer) As Window

  Dim i as integer
  Dim wc as integer
  Dim w as window

  ' Compute the total number of windows for iteration.
  wc = WindowCount - 1

  ' Go through the window list.
  for i = 0 to wc

    ' Get the window from the window list.
    w = Window(i)

    ' Is this a visible target window?
    if (w.Frame = windowType) and w.visible then

      ' This is the first visible document window.
      return w

    end if

  Next

  ' No visible window found of that type.
  return nil

End Function

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to