Example: ctrx_mouse_down

In the following example, after connecting to the Citrix server ludens, Microsoft's Word application is launched and some text is typed into the new document. The text is then highlighted, ctrx_mouse_down is invoked at the beginning of the text, and ctrx_mouse_up is recorded when the cursor has been drawn across the entire string.

Actions () {

     ctrx_connect_server("ludens", "test", "test", "ludens");
     ctrx_wait_for_event("LOGON");

     /* Double click on Microsoft Word icon */
     ctrx_mouse_double_click(37, 243, LEFT_BUTTON, 0, NULL);

     ctrx_set_window("Document1 - Microsoft Word"); /* wait for Word to appear */
     ctrx_type("This is a test ");

     /* Highlight "This is a test" with the mouse */
     ctrx_mouse_down(29, 138, LEFT_BUTTON, 0, "Document1 - Microsoft Word");
     ctrx_mouse_up(117, 137, LEFT_BUTTON, 0, "Document1 - Microsoft Word");

     lr_think_time(6);
     ctrx_key("DELETE_KEY", 0); /* delete text */
     lr_think_time(3);

     /* Exit Word */
     ctrx_mouse_click(24, 39, LEFT_BUTTON, 0, "Document2 - Microsoft Word");
     ctrx_set_window("Microsoft Word"); /* The "Do you want to save" dialog */
     /* Click on don't save */
     ctrx_mouse_click(44, 217, LEFT_BUTTON, 0, "Microsoft Word");

     /* Wait for Word to exit */
     ctrx_unset_window("Document1 - Microsoft Word");
     lr_think_time(2);
     ctrx_disconnect_server("ludens");

     return 0;
}