Microsoft KB Archive/137681

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

Article ID: 137681

Article Last Modified on 6/29/2004

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 6.0 Professional Edition
 * Microsoft Visual FoxPro 3.0b for Macintosh

-



This article was previously published under Q137681



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.



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.

Keywords: kbhowto kbsetup KB137681

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.