# AUI\_WINDOW > [HTML Version](aui_window.htm) **xcall AUI, AUI\_WINDOW, opflag \{,lft,top,rgt,btm \{,rows,cols \{,tsts,bsts \{,cid,hg,vg \{,monitors \{,winsts\}\}\}\}\}\}** The AUI\_WINDOW class is used for querying and changing the parameters of the window or monitor(s), such as its size, position, display state, number of rows and columns, etc. This function has both a [subroutine and a print tab implementation](subroutine-print-pairs.htm.md). **Parameters** _opflag_ ([Num](num.htm.md)) \[in\] specifies the window state desired, or an option to query the current state, per the following table. | **Symbol** | **Value** | **Meaning** | |------|------|------| | SW\_QRYCTLPIXCLI | \-4 | Same as SW\_QRYCTLPIX (-3), except that it returns the control's client rectangle in the lft,top,rgt and btm parameters, instead of the control's window rectangle relative to the desktop. The client rectangle always starts at 0,0, so that the rgt and btm parameters give the width and height of the "usable" area (not counting borders, menus, caption) of the control. | | SW\_QRYCTLPIX or SW\_QRYPIX | \-3 | Same as -1 (SW\_QRYCTLUNV) but returns the coordinates of the target window or control in pixels rather than Universal units. | | SW\_QRYMONPIX or SW\_QRYMON | \-2 | Query (multiple) monitor information. See _cid_. Returns rectangle (in pixel coordinates) in _lft, top, rgt, btm._ | | SW\_QRYCTLUNV or SW\_QUERY | \-1 | Query the current settings and update all of the passed parameters accordingly, return values in Universal units. See _cid_. | | SW\_HIDE | 0 | Hide window (i.e. make it invisible) | | SW\_SHOWNORMAL | 1 | Show window in normal format (neither minimized nor maximized) | | SW\_SHOWMINIMIZED | 2 | Activate window and show it minimized (displayed on the task bar) | | SW\_SHOWMAXIMIZED | 3 | Activate window and show it maximized | | SW\_SHOWNOACTIVATE | 4 | Show window in its most recent position but do not activate it | | SW\_SHOW | 5 | Activate and show window in its current size and position | | SW\_MINIMIZE | 6 | Minimize window and activate the next window in the task list | | SW\_MINNOACTIVE | 7 | Displays the window as a minimized window. This value is similar to SW\_SHOWMINIMIZED, except the window is not activated | | SW\_SHOWNA | 8 | Display window in its current size and position, but do not activate it | | SW\_RESTORE | 9 | Restore a minimized or maximized window to its original position | | SW\_WINDEFAULT | 10 | Display the window in the default state as defined in the shortcut or startup info associated with the application | | SW\_ASHDEFAULT | 65 | Causes the window to initially be reset based on the current settings file (as edited on the Settings menu and saved with the File..Save menu). Omit all other parameters, or set them to 0 (except -1 for _tsts_ and _bsts_). | _lft, top, rgt, btm_ ([Num](num.htm.md)) \[in/out\] specify or retrieve the coordinates of the Window or monitor. Window coordinates (_cid_ > 0) are in standardized units that range from 0,0 for the upper left corner of the screen to 10000,10000 for the bottom right. You may leave these 0 to retain the current window coordinates (if you just want to change the _rows_ / _cols_ or status lines.) Monitor coordinates (_opflag_ = -2, _cid_ < 0) are in pixels (and may be negative for secondary monitors). When _opflag_ = -1 and _cid_ < 0 (to retrieve desktop resolution), these parameters taken on new meaning. _lft_ and _top_ return the dialog (altpos) grid size in pixels, while _rgt_ and _btm_ return the primary monitor size in dialog (altpos) grid units. (This provides an idea of the maximum size dialog that will fit on the screen.) _rows ,cols_ ([Num](num.htm.md)) \[in/out\] | **cid** | **opflag** | **Target object, information returned (for queries)** | |------|------|------| | 0 | < 0 | Return the main window grid in rows and columns (e.g. 24 x 80) | | 0 | \>= 0 | Set the main window grid in rows and columns. Equivalent of tab(-5,rows) if rows > 0 and tab(-6,cols) if cols > 0 | | 0 | \>0 | Return the size of the target control in millirows and millcolumns. | | <0 | \-1 | Return the dialog size overhead (title bar, borders, margins) in universal coordinates. Note that as a general rule, the vertical overhead is equivalent to one logical row (one vertical dialog unit) and the horizontal overhead is negligible. | | <0 | \-3 | Return the dialog size overhead (title bar, borders, margins) in pixels. | _tsts, bsts_ ([Num](num.htm.md)) \[in / out\] specify or retrieve the visible / invisible state of the top and bottom status lines (1=visible, 0=invisible). You may leave these -1 (or omit them) to retain the current status line state. _cid_ ([String](string.htm.md) or [Num](num.htm.md)) \[in\] Identifies the window, control, or monitor that the operation is to be performed on, per the following table. Default is 0, i.e. the main window. See _Comments_. | **cid** | **opflag** | **Target object, information returned (for queries)** | |------|------|------| | \>0 (or name) | 0-9 | Perform the display operation specified by opflag (e.g. show, hide, etc.) on the specified control or window. No information returned. Operations on non-window controls may be limited to SW\_HIDE and SW\_SHOW. | | \>0 (or name) | \-1 or -3 | _cid _identifies the control to be queried by its control number or name. _lft_, _top_, _rgt_, _btm _return the coordinates of the control, in universal coordinates (if _opflag _= -1), or pixels (if _opflag _= -3). _rows _and _cols _return the logical size of the control in millirows and columns. | | 0 | \-1 or
-3 | Main window. _lft_, _top_, _rgt_, _btm _return the coordinates of the control, in universal coordinates (if _opflag _= -1), or pixels (if _opflag _= -3). _rows _and _cols _return the logical size of the control in millirows and columns. _tsts_, _bsts _indicate the status line presence. | | \-1 | \-1 | Primary monitor. _lft_ and _top_ return dialog (altpos) grid size. _rgt_ and _btm_ return monitor size in dialog units. _hg_ and _vg_ return monitor resolution in pixels. | | \-1 | \-2 | Primary monitor. _lft, top, rgt, btm_ return pixel coordinates of monitor. | | \-2 | \-1 | Primary monitor. Same as if _cid_ = -1 except subtracts area of the task bar from the returned parameters. | | \-2 | \-2 | Primary monitor work area. _lft, top, rgt, btm_ return pixel coordinates of monitor less task bar. | | \-3 | \-2 | Second monitor. _lft, top, rgt, btm_ return pixel coordinates of monitor (which may be negative if second monitor is to left of primary monitor). | | \-4 | \-2 | Second monitor work area. _lft, top, rgt, btm_ return pixel coordinates of monitor less task bar. | | \-5 | \-2 | Third monitor. _lft, top, rgt, btm_ return pixel coordinates of monitor. If there are three monitors, the assumed configuration is with the second monitor on the left, the third on the right. | | \-6 | \-2 | Third monitor work area. _lft, top, rgt, btm_ return pixel coordinates of monitor less task bar. | | \-99 | \-2 | Total virtual screen. _lft_, _top_, _rgt_, _btm _return pixel coordinates of the bounding rectangle for the combination of all the monitors. Note that in the case of multiple monitors, depending on their arrangement and configuration, there may be spaces within this rectangle which do not actually appear on any monitor. | _hg, vg_ ([Num](num.htm.md)) \[out\] These parameters, horizontal and vertical grid units, are applicable only when _opflag_ = -1 (i.e. for query mode). When _cid_ = -1, these return the screen resolution in pixels. Otherwise, they return the grid size, in universal units (0-10000) of the specified window or control. You can compare these grid values to the values returned in the _lft, top, rgt, btm_ coordinates to determine sizes and positions in terms of row/column units. _monitors_ ([Num](num.htm.md)) \[out\] When _opflag_ < 0, returns the number of monitors currently enabled. (You can then use opflag = -2 to retrieve information about individual monitors.) _winsts_ ([Num](num.htm.md)) \[out\] If specified with one of the query opflags, _winsts_ will return one of: | **Symbol** | **Value** | **Description** | |------|------|------| | SW\_HIDE | 0 | Window is hidden | | SW\_SHOWNORMAL | 1 | Window is neither minimized nor maximized | | SW\_SHOWMINIMIZED | 2 | Window is minimized | | SW\_SHOWMAXIMIZED | 3 | Window is maximized | Example: \! retrieve status of main window xcall AUI, AUI\_WINDOW, SW\_QUERY, 0,0,0,0, 0,0, 0,0, 0, 0,0,0, winsts switch winsts case SW\_HIDE ... **Examples** See the sample program AUIWIN \[908,28\] **Comments** When it comes to querying an individual control, the functionality of AUI\_WINDOW overlaps that of AUI\_CONTROL (with opcode CTLOP\_INFO). In choosing between them, note that CTLOP\_INFO returns coordinate information in logical millirows and columns, and relative to the parent of the control or window. These values will not be affected by moving the window or dialog around on the screen, or even resizing it. AUI\_WINDOW, on the other hand, returns raw coordinate information, typically in "universal coordinates", relative to the desktop. If using AUI\_WINDOW to hide or display a control other than the main window, set _cid _to the name of numeric ID of the control, and set all the intervening parameters to 0, except _tsts_ and _bsts_ which should be set to -1. This functionality overlaps with that of AUI\_CONTROL using _opcode_ CTLOP\_CHG.