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

WinGoto

Changes the active window. The specified window is placed in front of all other windows and all keyboard commands will apply to this window. You cannot call this function as an exit command (see Page Properties) or from a Cicode Object.

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

WinGoto(Window)

Window:

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

Return Value

0 (zero) if successful, otherwise an error is returned.

Related Functions

WinNew

Example

! If two windows are displayed;
WinGoto(1);
! Changes the active window to Window 1.
WinGoto(0);
! Changes the active window to Window 0.

See Also

Window Functions