%W_INFO

Get information about the windowing system

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
%W_INFO(wif_code1)
%W_INFO(wif_code2, window_id)
%W_INFO(wif_code3, window_id[, dataset_id])

Arguments

wif_code1

Returned with a value based on one of the following codes defined in winfo.def: (n)

WIF_MAXWND = Maximum number of windows

WIF_SROWS = Current number of screen rows

WIF_SCOLS = Current number of screen columns

WIF_TTCHNL = Terminal channel number

WIF_TMAR = Top margin value

WIF_BMAR = Bottom margin value

WIF_LMAR = Left margin value

WIF_RMAR = Right margin value

WIF_CAPTURE = ID of the window that has capture of the cursor

WIF_TTSTS = Detect characters in the type-ahead buffer: 1 for yes, 0 for no (Synergy .NET only)

wif_code2

Returned with a value based on one of the following codes defined in winfo.def: (n)

WIF_PLCFLG = Window is placed flag

WIF_BDRFLG = Border is enabled flag

WIF_TTLFLG = Window has a title flag

WIF_OCLFLG = Window is occluded flag

WIF_NOMFLG = Ignore margins on placement flag

WIF_ROWS = Number of window rows

WIF_COLS = Number of window columns

WIF_PLCROW = Requested placement row

WIF_PLCCOL = Requested placement column

WIF_ACTPROW = Actual placement row

WIF_ACTPCOL = Actual placement column

WIF_ROWPOS = Current position row

WIF_COLPOS = Current position column

WIF_PROW = Processing area upper-left row

WIF_PCOL = Processing area upper-left column

WIF_PROWSIZ = Processing area number of rows

WIF_PCOLSIZ = Processing area number of columns

WIF_DROW = Display area upper-left row

WIF_DCOL = Display area upper-left column

WIF_DROWSIZ = Display area number of rows

WIF_DCOLSIZ = Display area number of columns

WIF_FLDS = Number of window fields

WIF_CURFLD = Current window field

WIF_UFLDS = Number of user data set fields

WIF_UFLDSIZ = Size of each user data set field

WIF_HWND = System-specific window handle

WIF_UNDER = ID of window under the specified window

WIF_DRAGBAR = Window has a drag bar flag

WIF_CHILD = ID of the first child window of window_id

WIF_PARENT = ID of the parent of window_id or 0 if the window_id has no parent

WIF_NEXT = ID of the next sibling of window_id

WIF_CURSOR = ID of the cursor associated with window_id

WIF_POSX = Horizontal position of window_id in pixels

WIF_POSY = Vertical position of window_id in pixels

WIF_NORMALX = Normal (restored) horizontal position of window_id in pixels

WIF_NORMALY = Normal (restored) vertical position of window_id in pixels

WIF_STATE = State of window_id

wif_code3

Returned with a value based on the following codes defined in winfo.def: (n)

WIF_USERID = User data set ID exists flag

WIF_USRMEM = Memory handle to a user data set in a window

window_id

The ID of the window for which you want to get information or WID_CONTAINER to indicate the application container window. If zero or not passed, the last window ID referenced is used. (n)

dataset_id

(optional) The ID of the user data set for which you want to get information. (a)

Discussion

The %W_INFO function returns various types of information about the windowing system. This function can be called in three ways.

Note

%W_INFO is identical in function to W_INFO. The “WIF_” codes, however, are valid only with %W_INFO, not with the W_INFO subroutine.

Status flags are returned as true or false.

WIF_CAPTURE returns the ID of the window that currently has capture of the cursor (or WID_NONE in Synergy .NET). If no window has capture, or if capture has been established on a non-Synergy window (for example, a DLL function call), WIF_CAPTURE returns WID_NONE for the window ID.

A macro is provided in windows.def to simplify usage:

.define W_HOURGLASS_IS_ON
  &     ((%w_info(WIF_CAPTURE) .eq. WID_CONTAINER) .and.
  &     (%w_info(WIF_CURSOR, WID_CONTAINER) .eq. WPCS_WAIT))

which can be used as follows:

if (W_HOURGLASS_IS_ON)
  xcall w_proc(WP_HOURGLASS_OFF)

If there are characters in the type-ahead buffer (as detected by WIF_TTSTS), use W_PROC(WD_ACCEPT) to retrieve them.

WIF_HWND retrieves system-specific window handles (or returns 0 in Synergy .NET). With an increased demand for interoperability, especially in the Windows environments, comes the need to determine the system-specific window handle for a Synergy window. This handle can be passed to a DLL or C-interface routine to perform system-specific actions on the window. For instance, if you wanted to display bitmap graphics in a Synergy window, you could write a DLL routine to manage the image, but let the rest of the window management functions be handled by the Synergy runtime.

There are two special values for window_id: WIFH_CONTAINER, which is the container window for the Synergy application, and WIFH_APP, with is the application window. Synergy applications always have these two windows. The container window comprises the border and caption of the application and can contain the menu, toolbars, application window, and status windows (information line and footer). The application window only contains the space in which Synergy windows can be placed. Thus, the application window is a child of the container window, and all Synergy windows are children of the application window. Remember that anything you change in a Synergy window might conflict with internals of the Synergy runtime; to avoid problems use good subclassing techniques.

WIF_UNDER enables you to descend through the placement list to find the next window under a specified window. The return value is the ID of the next window that is partly or fully occluded by the specified window, or zero if no such window exists.

WIF_DRAGBAR enables your application to determine the present state of the drag bar for a window. On Windows, the existence of the drag bar (or caption) is independent of whether or not a title is on. For compatibility of window libraries and application code, we also maintain the drag bar state on UNIX and OpenVMS.

WIF_CHILD is used to retrieve the first child of a window. You can then use WIF_NEXT to loop through the remaining children. If no children exist for the specified window, WIF_CHILD returns zero.

WIF_NEXT returns the ID of the next window whose parent is the same window as the specified window. If no such window exists, zero is returned. The order of the siblings is the same as the order in which WP_CHILD was called to establish each relationship.

WIF_CURSOR returns the ID of the cursor specified for a Synergy window (or 0 in Synergy .NET). The returned cursor ID corresponds to the value passed to a prior call to W_PROC(WP_CURSOR, WP_SET). If no cursor has been specified for the window, WPCS_ARROW is returned.

Note

If WPCS_HANDLE is returned, no additional information is available for retrieving the handle to the cursor.

WIF_POSX and WIF_POSY return the current pixel location of the top left corner of a window (or 0 in Synergy .NET). If the window is a Synergy window, the position is relative to the client area of the application window (or relative to the tab, if the window belongs to a tab set).

WIF_NORMALX and WIF_NORMALY return the normal position of the top left corner of a window (or 0 in Synergy .NET), which is the restored position for the window. These work for a Synergy window as well as for the application container. For a Synergy window, the returned coordinates are relative to the client area of the window’s parent (usually the application window). The difference between WIF_POSX/WIF_POSY and WIF_NORMALX/WIF_NORMALY is that the former return the current position of the window with no regard to its current state, which means they might return negative values for a maximized window or an unreasonably large y coordinate for a minimized window.

WIF_STATE returns one of the following:

WPS_NORMAL

Window is normal.

WPS_MAXIMIZED

Window is maximized.

WPS_MINIMIZED

Window is minimized.

WPS_HIDDEN

Window is hidden.

In Synergy .NET, WIF_STATE always returns WPS_NORMAL for the container and WPS_NORMAL or WPS_HIDDEN for a Synergy window, depending on whether or not it is placed.

WIF_USRMEM returns a Synergy DBL memory handle to a user data set in a Synergy window. The handle is global and may not be freed or resized; if you attempt this, the error message: “Invalid memory handle” is generated.

If dataset_id is not passed, the most recently accessed user data set for this window is implied (see WP_FIND). After the call to WIF_USRMEM, the specified user data set becomes the current one (for subsequent calls to W_FLDS and W_INFO).

The returned handle may be used with the ^M casting operator to read or write data in the window’s user data set, using a STRUCTURE.