How To Control the Screen Size of an .Exe File at Startup

Last reviewed: March 11, 1997
Article ID: Q137681
3.00 5.00 |3.00b
WINDOWS   MACINTOSH
kbprg kbenv kbui kbhowto

The information in this article applies to:

  • Microsoft Visual FoxPro for Windows, versions 3.0, 5.0
  • Microsoft Visual FoxPro for Macintosh, version 3.0b

SUMMARY

By default, when you run a Visual FoxPro application's .exe file, the application opens in a screen or window that is not maximized. This article gives two methods you can use to change this behavior to force the application to run maximized. You can do it by using a command in the main program or by setting a property for the .exe file at the level of the operating system.

MORE INFORMATION

Using Commands in the Main Program

To maximize the screen by using a command in the main program file, enter one of the following two commands in the main program of the application:

   zoom window screen max

   -or-

   _screen.windowstate = 2

In the first case, the command treats the desktop screen like a window and maximizes it the way it would any other window.

In the latter case, because the Visual FoxPro desktop screen (_screen) is itself created as an object, you can manipulate its properties. The command resets the screen's WindowState property, which controls whether the screen (or window) is run as normal (0), minimized (1), or maximized (2).

NOTE: these commands have no effect if issued from the Config.fpw file. They take effect only if issued from the program's main program file. This means that the desktop screen will always first appear as not maximized. The screen will then be resized by whichever command is issued in the main program and the user will see the resize taking place. These commands do not hide the resizing from the user.

Using the Operating System

Alternatively, you can change the size of the opening screen at the Operating system level. In Windows version 3.11 and Windows NT, in the program item properties, you can specify that the .exe file be run minimized. This will hide the screen from users when it first is run. Then you can use the zoom window command or _screen.windowstate to maximize the screen. This may be most effective on faster computers.

In Windows 95, you can create a shortcut for the .exe file, and set the run property to maximized. To do this, create a shortcut, right-click the shortcut, click Properties, click the Shortcut tab, and click Maximized. If you use this alternative, you don't need to use a command in the main program to run the application maximized.


Additional reference words: 5.00 vFoxMac 3.00b 3.00 VFoxWin
KBCategory: kbprg kbenv kbui kbhowto
KBSubcategory: FxotherGeneral
Keywords : FxotherGeneral kbenv kbhowto kbprg kbui
Version : 3.00 5.00 |3.00b
Platform : MACINTOSH WINDOWS


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: March 11, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.