ctrx_get_window_name_by_id

Example

Retrieves the name (caption) of the window specified by a given window ID.

int ctrx_get_window_name_by_id(long window_id, LPSTR buffer);

window_id

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

bufferThe output parameter containing the name of the window.

Return Values

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

Parameterization

Parameterization is not available for this function.

Example

In the following example, the ctrx_get_window_id_by_order function searches for the second window in the stack (in position 1, under the topmost window). It returns the numeric identifier of the window. The ctrx_get_window_name_by_id function retrieves the name of the window based on the numeric identifier. The lr_log_message function prints a message with the name of the window to the log.

Copy code
char window_name[100];
    
    ctrx_get_window_name_by_id(ctrx_get_window_id_by_order(1), window_name);     
    lr_log_message("The second window by focus order is: %s", window_name);