Citrix ICA Vuser Functions (CTRX) > Alphabetical List of Functions > ctrx_activate_window

ctrx_activate_window

Example Information Retrieval Functions

Activates a window.

int ctrx_activate_window(char *window_name, [CONTINUE_ON_ERROR,] CTRX_LAST);

window_name The window title.
CONTINUE_ON_ERROR A constant, entered without quotes, as shown. Overrides the error behavior runtime setting for this step so that the script behaves as though the runtime setting was CONTINUE ON ERROR.
CTRX_LAST A marker that indicates the end of the argument list.

ctrx_activate_window is a function that makes a window active by settings an input focus to it.

The window_name argument indicates the name of the window that ctrx_activate_window tries to set in focus, as it appears in the window's top header frame.

The window must exist before calling ctrx_activate_window, and it must be visible—that is, it is not possible to activate a window that is minimized.

Return Values

Citrix ICA Return Values

Parameterization

window_name can be parameterized.

Example

This example shows the use of ctrx_activate_window on a Desktop session with a number of applications open.

//bring focus to Notepad
ctrx_activate_window("Untitled - Notepad", CTRX_LAST);

//make Calculator active
ctrx_activate_window("Calculator", CTRX_LAST);