How to Create a Startup Message Screen

ID: Q104343

2.00 2.50 2.50a 2.50b 2.60 | 2.50 2.50a 2.50b 2.60

MS-DOS                     | WINDOWS
kbprg

The information in this article applies to:

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

Keywords          : FxtoolSbuilder 
Version           : 2.00 2.50 2.50a 2.50b 2.60 | 2.5
Platform          : MS-DOS WINDOWS

Last Reviewed: April 30, 1996