%U_WNDTYPE

Return a window’s type

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
window_type = %U_WNDTYPE(window_id)

Return value

window_type

Returns one of the window types listed in the table in the Discussion. (^VAL)

Arguments

window_id

The window ID whose type you want to retrieve. (n)

Discussion

%U_WNDTYPE returns a window’s type, regardless of the routine used to load the window. It may return any of the following:

Return value

Window description

D_WTYPE_ACTIVEX

Container window for an ActiveX control. (Created by %AX_TKWIN or %AX_TKSINGLE.)

D_WTYPE_COLUMN

Menu column. (Created by the .COLUMN script command or by calling MB_END.)

D_WTYPE_CONTAINER

Composite container window. (Created by the DC_CREATE subfunction to %C_CONTAINER.)

D_WTYPE_DOTNET

Container window for a .NET form, .NET control, or WPF element. (Created by %DOTNET_TKWIN.)

D_WTYPE_INPUT

Input window (Created by the .INPUT script command or by calling the IB_END routine.)

D_WTYPE_LISTCLASS

List class (Created by the .LISTCLASS script command or by calling L_CLASS.)

D_WTYPE_SELECT

Selection window (Created by the .SELECT script command, by calling S_SELBLD, or by calling I_LDINP for a .FIELD script command with a SELECT qualifier.)

D_WTYPE_TABS

Tabbed window (Created by %TS_TABSET.)

D_WTYPE_TEXT

Text window (A window for which T_SETUP has been called—there’s no other distinction in Toolkit between a text window and a general window.)

D_WTYPE_OTHER

None of the above.

It is possible that more window types will be added to the list in the future and that D_WTYPE_OTHER could at some point encompass different types of windows. Consequently, it should only be used as an “else” case.

Tip

The D_WINDOW_TYPE subfunction of %E_INFO also returns a window’s type. However, if U_DLWND was used to load the window, D_WINDOW_TYPE returns D_WTYPE_OTHER, so it’s useful only for windows loaded with a type‑specific routine—for example, I_LDINP for an input window.

Examples

The following example uses %U_WNDTYPE to determine how to process the windows in a window library.

count = %u_enumwnds(channel, max, window)
for ndx from 1 thru count
  begin
     xcall u_ldwnd(id, channel, window(ndx))
     using %u_wndtype(id) select
     (D_WTYPE_LISTCLASS),   call process_listclass
     (D_WTYPE_INPUT),       call process_input
     .
     .
     .
endusing
  end