Microsoft KB Archive/104593

From BetaArchive Wiki

Determining If Browse Window Activated/Deactivated

ID: Q104593

2.50 2.50a | 2.00 2.50 2.50a

WINDOWS         | MS-DOS

kbprg 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

Keywords          : FxprgBrowse 
Version           : 2.50 2.50a | 2.00 2.50 2.50a
Platform          : MS-DOS WINDOWS

Last Reviewed: April 30, 1996
© 1999 Microsoft Corporation. All rights reserved. Terms of Use.