Creating, Inquiring, Modifying, and Destroying Windows

You create a floating window with the DISPLAY FLOATING WINDOW statement. This statement constructs the specified window and returns a handle to it. A window created with the above statement is modal by default (the MODAL phrase can be added as commentary). To create a modeless window, you can add the MODELESS phrase. Note that managing multiple modeless windows is greatly simplified by associating a separate thread with each modeless window. See Multiple Execution Threads for more informaqtion.

The program's initial window, or main application window, is created either automatically, via the run-time system, or programmatically via the DISPLAY INITIAL WINDOW statement. If the first DISPLAY statement is not a DISPLAY INITIAL WINDOW (or DISPLAY STANDARD WINDOW statement), the run-time system automatically creates the initial window. The main application window is always a modeless window.

Because floating windows can be moved and, optionally, resized, their position and size are dynamic. To retrieve the current position and size of a floating window, you use the INQUIRE verb. INQUIRE returns information for the current window or the window identified by the specified handle.

To programmatically reposition or change the size or title of a window, you use the MODIFY verb. The MODIFY statement applies the specified values to the window identified by the handle or, if omitted, the current floating window.

Windows have a property called ACTION that can be used in DISPLAY and MODIFY statements. The ACTION property allows you to programmatically maximize, minimize, or restore a window. To use ACTION, assign it one of the following values (these names are found in acugui.def):

If you assign an ACTION value that is not allowed, there is no effect other than to trigger the ON EXCEPTION phrase of the MODIFY statement (if present). Note that you can use the ACTION phrase to create a window that is initially maximized or minimized.

You destroy a floating window with either the CLOSE WINDOW statement or DESTROY verb. You specify the handle of the window you want to destroy. Both verbs behave identically when acting on floating windows. You cannot destroy the main application window. It is closed automatically when the application terminates.

See Procedure Division Statements for a complete description of each of the above verbs. See Screen Description Entry for detailed information regarding creating and managing floating windows via the Screen Section.