Example: ctrx_get_text_location

This example shows the use of ctrx_get_text_location.

long x_pos, y_pos, wid, ht;
ctrx_sync_on_window("Desktop", ACTIVATE, 0, 0, 801, 601, "snapshot6", CTRX_LAST );
/* ctrx_get_text used to get coordinates and snapshot file
    for later call to ctrx_get_text_location */

ctrx_get_text(NULL, 289, 70, 100, 70, "snapshot1", text_buffer, CTRX_LAST );
lr_message( "%s", text_buffer );
x_pos = 289;
y_pos = 70;
wid = 100;
ht = 70;
ctrx_get_text_location(NULL, &x_pos, &y_pos, &wid, &ht, 
    "Documents", TRUE, "snapshot1", CTRX_LAST );

lr_message( "%ld, %ld, %ld, %ld ",x_pos,y_pos, wid, ht );

if (x_pos == 0 && y_pos == 0 && wid== 0 && wid == 0 )
    lr_message("'Documents' not found");
else
    lr_message("'Documents' found at %d, %d, %d, %d", x_pos, y_pos, wid, ht );
Output:
Starting action Action.
Action.c(7): ctrx_sync_on_window("Desktop")
Action.c(9): ctrx_get_text(".My Documents")
.My Documents
Action.c(18): ctrx_get_text_location(319 , 116 , 52 , 8)
319, 116, 52, 8
'Documents' found at 319, 116, 52, 8