Active and Current Windows

A floating window may be active. The active window is the window that the user's input goes to (also referred to as the window that has focus). This active window is usually highlighted in some way. For example, under Microsoft Windows NT, the active window is shown in the color scheme defined in the Appearance tab of the Display Properties dialog box.

A floating window may also be current. The current window is the window that the application uses whenever it does not explicitly refer to a window (essentially, it is the default window). The current window is the window to which output is directed. The current window is usually the same as the active window, but it need not be. For example, if the application wants to display some text in an inactive window, it would make that window the current window and display text to it. Note that changing the current window does not affect the input focus of the active window.

You can use the UPON phrase of the DISPLAY statement to temporarily change the current window. You can also use the SET verb to change the current window. For more information about the UPON Phrase, see Common Screen Options in the Reference Manual. For a complete description of the SET Statement, see Procedure Division Statements in the Reference Manual.

Any time you execute an ACCEPT verb that retrieves input from the user, the first thing that happens is that the run-time system makes the active window current. This ensures that the program is referring to the same window that the user is using to enter data.

When a floating window is first created, it is made both the active and current window. When a window is destroyed, the first applicable rule applies:

  1. If the destroyed window was active, its parent window is made both current and active.
  2. If the destroyed window was current, its parent window is made current.
  3. Otherwise, the current and active windows remain unchanged.

Except for the main application window, all windows have a parent window.