BUG: WONTOP() Does Not Return Topmost Window

Last reviewed: August 28, 1995
Article ID: Q120544
The information in this article applies to:
  • Microsoft FoxPro for Windows, versions 2.6, 2.6a

SYMPTOMS

The window name returned by WONTOP() is not the topmost window, or, when the name of the topmost window is specified as a parameter, WONTOP() returns .F. instead of returning .T.

CAUSE

A window was defined with the IN DESKTOP clause. That window is active when the WONTOP() function is called.

RESOLUTION

Before calling the WONTOP() function, use the DEACTIVATE WINDOW command to deactivate any window that was defined with the IN DESKTOP clause.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

When a window is defined with the IN DESKTOP clause and that window is active, WONTOP() will return the name of that window instead of returning the name of the topmost window. WONTOP() will return the name of the topmost window when no windows that were defined with the IN DESKTOP clause are active.

Steps to Reproduce Problem

Run the following code:

   DEFINE WINDOW x FROM 10,10 TO 20,20 TITLE 'WINDOW x' IN DESKTOP
   DEFINE WINDOW y FROM 10,10 TO 20,20 TITLE 'WINDOW y'
   ACTIVATE WINDOW x
   ACTIVATE WINDOW y TOP

   ? WONTOP() && This will return x.  It should return y.

   = INKEY(0)
   RELEASE WINDOW x
   RELEASE WINDOW y


Additional reference words: FoxWin buglist2.60 buglist2.60a 2.60a 2.60
KBCategory: kbprg kbbuglist
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: August 28, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.