Microsoft KB Archive/120544

{| = BUG: WONTOP Does Not Return Topmost Window =
 * width="100%"|

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
 * }