How to List the Currently Active Windows in a Menu

Last reviewed: June 27, 1995
Article ID: Q97635
The information in this article applies to:
  • Microsoft FoxPro for Windows, versions 2.5 and 2.5a
  • Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, and 2.5a

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


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 27, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.