How to List the Currently Active Windows in a Menu

ID: Q97635

The information in this article applies to:

To create a menu popup that lists the currently active windows, create a quick menu and delete all the menu pads but the Window menu pad.

In order for the active windows to be listed, there must be at least one menu bar (menu option) in the Window menu popup. If there are no other menu bars in the Window menu popup, the popup will not activate.

To create a menu bar that allows the popup to activate and that describes the items following it, use the following code segment:

   SET SYSMENU TO

   SET SYSMENU AUTOMATIC

   DEFINE PAD _MSM_WINDO OF _MSYSMENU PROMPT "\<Window" ;
      COLOR SCHEME 3  KEY ALT+W, ""

   ON PAD _MSM_WINDO OF _MSYSMENU ACTIVATE POPUP _mwindow

   DEFINE POPUP _mwindow MARGIN RELATIVE SHADOW COLOR SCHEME 4

   DEFINE BAR 1 OF _mwindow PROMPT "----Active-----" ;
      SKIP FOR .t.

   ON SELECTION BAR 1 OF _mwindow return ""

NOTE: The reserved name _MWINDOW must be used as the name of the menu popup. If _MWINDOW is not used, the currently active windows will not be displayed in the popup. However, _MSYSMENU and _MSM_WINDOW, the names of the menu and the menu pad, are not necessary for this purpose and can be changed.

Additional reference words: FoxDos FoxWin 2.00 2.50 2.50a KBCategory: kbprg KBSubcategory: FxprgGeneral

Last Reviewed: June 27, 1995