Retrieves the position of the window specified by a given window ID.

int ctrx_get_window_pos_by_id(long window_id, long * x, long * y);


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

xOutput parameter containing the X coordinate of the window position.
yOutput parameter containing the Y coordinate of the window position.

Return Values

If the function finds the specified window, it returns E_OK. Otherwise, it returns E_GENERAL_ERROR or E_DISCONNECTED.


Parameterization is not available for this function.


In the following example, the ctrx_get_window_id_by_order function searches for the topmost window in the stack (in position 0). It returns the numeric identifier of the window. The ctrx_get_window_pos_by_id function uses the numeric identifier to search for the window, and retrieves the X, Y coordinates of the window. The lr_log_message function prints the coordinates to the log.

Copy code
long x, y;

    ctrx_get_window_pos_by_id(ctrx_get_window_id_by_order(0), &x, &y);
    lr_log_message("window position: %ld, %ld",x ,y);