How to Create a Startup Message Screen

Last reviewed: April 29, 1996
Article ID: Q104343
The information in this article applies to:
  • Microsoft FoxPro for MS-DOS, versions 2.5, 2.5a, 2.5b, 2.6
  • Microsoft FoxPro for Windows, versions 2.5, 2.5a, 2.5b, 2.6

SUMMARY

Many Microsoft Windows-based applications display a message with title, copyright, and version information while a program is starting. This is primarily to make a slow initialization seem faster. It is possible to accomplish this same technique with FoxPro.

MORE INFORMATION

To create your screen, use the screen generator to create a screen that has the desired information. Normally, this includes information about copyright, version, user identification, and title. It can also include identifying graphics such as the application icon.

To set the attributes for the screen, choose the Window Style push button in the Screen Layout dialog box. A typical startup message screen in FoxPro should be defined as type User with a single line border. It is not necessary for the screen to include a title bar. Also, provide a name for the startup message screen in the box provided in the Screen Layout dialog box in order to control the window from the program.

This screen only needs to be displayed for a short time during startup and needs to be removed without user intervention. To accomplish this, include the #NOREAD generator directive in the SETUP code of the screen file. This will prevent a READ clause from being added to the screen program.

Save the screen without the environment settings and generate. This will prevent the screen from opening and closing any files during execution.

During the beginning portion of a program before menus get run, databases opened, and environment variables initialized, include a line to run the screen like the following:

   DO OPENING.SPR

When the initialization process has completed, issue the following command:

   RELEASE WINDOW <windowname>

This command will remove the startup message screen and continue normal execution of the program.

On some faster computers, the screen may flash by so fast that the user will not be able to read it. A different technique must be allowed to work around these undesirable results.

Instead of implementing this with the #NOREAD generator directive, use the #READCLAUSES generator directive to add a TIMEOUT clause to the READ command that is created by GENSCRN.PRG.

In the SETUP code for the screen, add a line similar to the following:

   #READCLAUSES TIMEOUT 3

When you add a line to DO this screen during the beginning portion of your program, it will display for three seconds before being cleared.


Additional reference words: FoxDos FoxWin 2.50 2.50a startup initial 2.60
KBCategory: kbprg
KBSubcategory: FxtoolSbuilder


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.