How to Prevent Windows from Flashing with the RUN Command

Last reviewed: April 18, 1995
Article ID: Q104886
The information in this article applies to:
  • Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, and 2.5a

In FoxPro for MS-DOS, when a RUN command is issued to execute external commands, the screen may flash for a brief moment while the command is executed. This might be an undesirable effect when there are active windows on the screen.

You can prevent the active windows from blinking when the RUN command is issued by using the following program. This program uses the ACTIVATE SCREEN command to change the focus to the desktop and the HIDE WINDOW SAVE command to save the image of the windows on the screen. It also requires that the STATUS BAR be OFF.

   ON KEY LABEL F5 DO pnoblink
   SET STATUS OFF   && Status bar needs to be off
   SET TALK OFF
   DEFINE WINDOW win1 FROM 1,1 TO 10,34    && Defines two windows
   *                                          and activates them
   @ 24,20 SAY "Press F5 to activate the MS-DOS command"
   ACTIVATE WINDOW win1
   @ 3,4 GET x DEFAULT 1
   DEFINE WINDOW win2 FROM 11,1 TO 20,34
   ACTIVATE WINDOW win2
   @ 4,4 GET y DEFAULT 4
   READ CYCLE
   * Deactivates the windows
   DEACTIVATE WINDOW win1
   DEACTIVATE WINDOW win2
   RELEASE WINDOW ALL
   CLEAR


   PROCEDURE pnoblink
   ACTIVATE SCREEN         && Changes the focus to the desktop
   HIDE WINDOW ALL SAVE    && Displays an image of the window on
   *                          the desktop
   WAIT WINDOW "Processing the DOS command... please wait" NOWAIT
   RUN /0 DIR >test.txt   && Directs the echoing of the command to
   *                         a file
   WAIT CLEAR
   @ 24,20 CLEAR
   @ 24,25 SAY "Press CTRL+W to exit the READ"
   ACTIVATE WINDOW win1


Additional reference words: FoxDos 2.00 2.50 2.50a flicker scroll
KBCategory: kbprg kbcode
KBSubcategory:


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 18, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.