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

ctrx_win_exist

Example Citrix Synchronization Functions

Checks if a window is visible on the screen.

int ctrx_win_exist( char *window_name, long waiting_time, [CONTINUE_ON_ERROR,] CTRX_LAST );

window_name The name of the window to check
waiting_time Indicates the timeout to wait, in seconds
CONTINUE_ON_ERROR A constant, entered as shown without quotes. Overrides the error behavior run-time setting for this step so that script behaves as though the run-time setting was Continue on error.
CTRX_LAST A marker that indicates the end of the argument list.

ctrx_win_exist returns E_OK (zero) if the window exists. The wildcard character (*) can be used in window_name.

Return Values

Citrix ICA Return Values

Parameterization

No parameterization is available for this function.

Example

In the following example, ctrx_win_exist checks if the web browser has launched. If it doesn't appear within the specified waiting_time , ctrx_mouse_double_click launches the web browser from the desktop.

/* If browser has not launched in nine seconds, click the desktop IE icon */
if (!ctrx_win_exist("Welcome to MSN.com - Microsoft Internet Explorer", 9, CTRX_LAST))
ctrx_mouse_double_click(34, 325, LEFT_BUTTON, 0, NULL, CTRX_LAST);

lr_think_time(13);
ctrx_set_window("Welcome to MSN.com - Microsoft Internet Explorer", CTRX_LAST);

/* Exit the web browser by clicking on top left Exit check box */
ctrx_mouse_click(573, 61, LEFT_BUTTON, 0,
"Welcome to MSN.com - Microsoft Internet Explorer", CTRX_LAST);