Determining If Browse Window Activated/Deactivated

Last reviewed: April 29, 1996
Article ID: Q104593
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

SUMMARY

The DEACTIVATE and ACTIVATE clauses of the READ command are not executed for a window that does not contain a GET object. Therefore, these clauses will not be executed when a Browse window is activated or deactivated.

MORE INFORMATION

It is possible to determine if a Browse window has been activated or deactivated. The ACTIVATE and DEACTIVATE clauses are executed only when a window, with GET objects and in the active READ command, is activated or deactivated.

To test for the activation of a Browse window, you could place code with the READ window to test for the WONTOP() function. If the WONTOP() function is used with the Browse window, code associated with activating the Browse window could be executed. For example:

   DEFINE WINDOW test1 FROM 1,17 TO 25,79
   DEFINE WINDOW test2 FROM 1,1 to 15,79
   USE customer
   BROWSE WINDOW test2 NOWAIT SAVE
   ACTIVATE WINDOW test1
   @ 1,1 GET x DEFAULT '   '
   READ CYCLE ACTIVATE myproc() DEACTIVATE myproc()

   FUNCTION myproc
   IF WONTOP()='CUSTOMER'
       WAIT WINDOW 'Browse window is activated!!' NOWAIT
   ELSE
      WAIT WINDOW 'Browse window is not activated!!' NOWAIT
   ENDIF
   RETURN .f.


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


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: April 29, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.