Share this page

# ctrx_set_window

Citrix Synchronization Functions

Waits for a window to appear in the Citrix client.

`int ctrx_set_window( char *window_name, [window_state,] [CONTINUE_ON_ERROR,] CTRX_LAST );`

window_name | The window title.
window_state | Window state to wait for: WIN_EXISTS or WIN_ACTIVE. Note: The window_state argument can be used with or without quotes, both formats work.
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.

When emulating a GUI user, a window must appear before it can be used.

ctrx_set_window is a synchronization function that waits for a window to appear before the Vuser emulates any keyboard or mouse activity in the window.

The window_name argument indicates the name of the window that ctrx_set_window waits for, as it appears in the window's top header frame. The asterisk wildcard character (*) can be used in window_name.

The window_state argument is optional. It indicates the state of the window that ctrx_set_window waits for. The function can wait for the window to appear (WIN_EXISTS) or to appear and become active (WIN_ACTIVE). This argument is similar to the event argument of ctrx_sync_on_window.

If there is a succession of windows appearing in a short period of time, VuGen will only record the last call to ctrx_set_window.

## Return Values

Citrix ICA Return Values

## Parameterization

The parameter window_name can be parameterized.

## Example

Copy code

    Actions ()
    {
        ctrx_connect_server("ludens", "test", "test", "ludens", CTRX_LAST);
        ctrx_wait_for_event("LOGON", CTRX_LAST);
        /* <i>Launch the web browser by clicking on desktop IE icon </i>*/
        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);
        /* <i>Exit the web browser by clicking on top left Exit check box</i> */
        ctrx_mouse_click(573, 61, LEFT_BUTTON, 0, "Welcome to MSN.com - Microsoft Internet Explorer", CTRX_LAST);
        lr_think_time(12);
        ctrx_disconnect_server("ludens", CTRX_LAST);return 0;
    }

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: