Cicode Programming Reference > Cicode Function Categories > Window Functions Introduction > WinSelect

WinSelect

Selects a window to make active. This function only affects the output of Cicode functions. It does not change the screen focus of the windows, or move a background window to the foreground.

Always re-select the original window if it is called from a Page database (Page Numbers, Page Symbols, and so on), because other Cicode tasks will assume it is the correct window. This function only changes the active window for the Cicode task that called it.

Note: This function is not supported in the server process in a multiprocessor environment. Calling this function from the server process results in a hardware alarm being raised.

Syntax

WinSelect(Window)

Window:

The window number to select. Be aware that this is not the same as the window handle returned from the WndFind() function.

Return Value

The old window number.

Related Functions

WinGoto, WinNumber

Example

OldWindow=WinSelect(1);
! Selects window number 1.
Prompt("Message to Window 1");
! Sends message to window number 1.
WinSelect(2);
! Selects window number 2.
Prompt("Message to Window 2");
! Sends message to window number 2.
WinSelect(OldWindow);
! Selects original window.

See Also

Window Functions