ctrx_activate_window_by_id

Example

Activates the window specified by a given window ID.

int ctrx_activate_window_by_id(long window_id);

window_id

A unique window ID, returned by a function such as ctrx_get_window_id_by_order.

Return Values

If the function succeeds, it returns E_OK. Otherwise, it returns E_GENERAL_ERROR or E_DISCONNECTED.

Parameterization

Parameterization is not available for this function.

Example

In the following example, the ctrx_find_window_by_name function searches for a window with the name "New Tab - Google Chrome." If it finds a window with a matching name, it returns the numeric identifier of the window. The ctrx_activate_window_by_id function uses the numeric identifier to find the window and activate it.

Copy code
ctrx_activate_window_by_id(ctrx_find_window_by_name("New Tab - Google Chrome", MATCH_Exact));