ACTIVATE WINDOW Command

Displays and activates one or more user-defined windows or Visual FoxPro system windows.

ACTIVATE WINDOW WindowName1 [, WindowName2 ...]
| ALL   [IN [WINDOW] WindowName3 | IN SCREEN   
[BOTTOM | TOP | SAME]    [NOSHOW]

Parameters

  • WindowName1 [, WindowName2 ...]
    Specifies the name of each window to activate. Separate the window names with commas. In Visual FoxPro, you can specify the name of a toolbar to activate. See SHOW WINDOW for a list of Visual FoxPro toolbar names.

  • ALL
    Specifies that all windows are activated. The last window activated is the active output window.

  • IN [WINDOW] WindowName3
    Specifies the name of the parent window within which the window is placed and activated. The activated window becomes a child window. A parent window can have multiple child windows. A child window activated inside a parent window cannot be moved outside the parent window. If the parent window is moved, the child window moves with it.

    Note   The parent window must be visible for any of its child windows to be visible.

  • IN SCREEN
    Places and activates a window in the main Visual FoxPro window. A window can be placed in a parent window by including IN WINDOW in DEFINE WINDOW when the window is created. Including the IN SCREEN clause in ACTIVATE WINDOW overrides the IN WINDOW clause in DEFINE WINDOW.

  • BOTTOM | TOP | SAME
    Specifies where windows are activated with respect to other previously activated windows. By default, a window becomes the window on top when it is activated. Including BOTTOM places a window behind all other windows. TOP places it in front of all other windows. SAME activates a window without affecting its front-to-back placement.

  • NOSHOW
    Activates and directs output to a window without displaying the window.

Remarks

To successfully use this command on user-defined windows, any target user-defined window must have been created using the DEFINE WINDOW command.

Activating a window makes it the window on top and directs all output to that window. Output can be directed to only one window at a time. A window remains the active output window until it is deactivated or released, or until another window or the main Visual FoxPro window is activated.

The names of user-defined windows appear in the bottom section of the Window menu. The name of the active user-defined window is marked with a check mark.

More than one window can be placed in the main Visual FoxPro window at one time, but output is directed only to the last window activated. When more than one window is open, deactivating the active output window removes it from the main Visual FoxPro window and sends subsequent output to another window. If there is no active output window, output is directed to the main Visual FoxPro window.

Note   To ensure output is directed to a specific window when you deactivate the active output window, you must explicitly activate the window you want to send output to with ACTIVATE WINDOW.

All activated windows are displayed until DEACTIVATE WINDOW or HIDE WINDOW is issued to remove them from view. Issuing either command removes windows from view but not from memory. Windows can be redisplayed by issuing ACTIVATE WINDOW or SHOW WINDOW.

To remove windows from view and from memory, use CLEAR WINDOWS, RELEASE WINDOWS, or CLEAR ALL. Windows that are removed from memory must be redefined to place them back in the main Visual FoxPro window.

You can use ACTIVATE WINDOW to place Visual FoxPro system windows in the main Visual FoxPro window or in a parent window.

The following system windows can be opened with ACTIVATE WINDOW:

  • Command
  • Call Stack
  • Debug
  • Debug Output
  • Document View
  • Locals
  • Trace
  • Watch
  • View

To activate a system window and or a toolbar, enclose the entire system window or toolbar name in quotation marks. For example, to activate the Call Stack debugging window in Visual FoxPro, issue the following command:

ACTIVATE WINDOW "Call Stack"

Use HIDE WINDOW or RELEASE WINDOW to remove a system window from the main Visual FoxPro window or a parent window.

Example

The following example defines a window named output and activates it, placing it in the main Visual FoxPro window. The WAIT command pauses execution, the window is hidden, and then redisplayed.

CLEAR
DEFINE WINDOW output FROM 2,1 TO 13,75 TITLE 'Output' ;
   CLOSE FLOAT GROW ZOOM
ACTIVATE WINDOW output
WAIT WINDOW 'Press any key to hide window output'
HIDE WINDOW output
WAIT WINDOW 'Press any key to show window output'
SHOW WINDOW output
WAIT WINDOW 'Press any key to release window output'
RELEASE WINDOW output

See Also

CLEAR WINDOWS | DEACTIVATE WINDOW | DEFINE WINDOW | HIDE WINDOW | RELEASE WINDOWS | SHOW WINDOW