Example: ctrx_run_published_app

In the following example, ctrx_run_published_app invokes Notepad and ctrx_sync_on_window waits for the window come into focus.

Action() {
	ctrx_connect_server("server", "login", "pwd", "domain");
	ctrx_wait_for_event("LOGON");
	if(ctrx_run_published_app("Notepad", CTRX_LAST) == E_OK) {
		 ctrx_sync_on_window( "Untitled - Notepad", ACTIVATE, 50, 50, 300, 300, "notepad_snapshot", CTRX_LAST);
	}
	ctrx_logoff(CTRX_NORMAL_LOGOFF, CTRX_LAST);
	ctrx_disconnect_server("server", CTRX_LAST);	
	return 0;
}