Send keys to Remote Desktop

  • Thread starter Thread starter Etienne Charland
  • Start date Start date
E

Etienne Charland

Hi, there is an application running on a remote desktop (under Citrix ICA,
but the same problem applies for RDC or PC Anywhere). Now, I want to send
keys to the remote application from a local app. I tried sending keys in VB
with SendKeys, as well as using keybd_event API, but I'm not able to send
any keys. It works very well for any local applications, but I can't pass
the keys remotely. Is there any way to do it?

Thanks!
Etienne
 
Never use send keys....it's a hack at best. Only the app with focus will
get the message, which is never guaranteed.

Look under Remoting in VS.NET help

Jeff
 
What I am trying to achieve is a hack around an existing system! The remote
interface is too crappy, so I want to automate data entry with a local
application.
 
Not with Send Keys! Speaking of hack

Remote interface is crappy? Is that a technical term? Perhaps you
misunderstood my suggestion...Remoting is a new feature of .NET that takes
over from NETDDE and sockets.

And you are trying to operate through PC Anywhere to control a remote app?

Jeff
 
Look, I haven't written the application and I'm not the administrator. It
runs remotely and I access it through Citrix ICA (which is the same thing as
RDC or PC Anywhere). I can't run any utility server-side. If I want to
automate tasks, the best I can do is to send a serie of keyboard keys.

Etienne
 
So you're gonna write an app that runs on your desktop, that sends keys to a
Citrix session, that passes the keys onto the remote desktop? Destined to
fail, sorry. Too many things to go wrong.

What exactly is the remote app? Is it a mainframe application by chance? So
you can't run this same application locally?

So they've given you the task of managing this remote application, but won't
let you touch the remote machine? So they've chosen an unreliable approach?
Perhaps you need to educate management? Find a new job? Just checking, and
just joking :-)

You posted here asking for answers, and we've given you some. Your choice to
listen or not.

Jeff
 
I am not paid to develop the system; I am paid to use it. I just want to use
it more efficiently. And I must to do without having admin access to the
server in any way. Although I am very limited in the solutions, there is
something I can do: send keys to fill fields with the right data. I can't
get this to work for an unknown reason and I don't see any other way to
communicate with the software.

Etienne
 
So you are sending keys to the Citrix window??

Please define "can't get this to work". How are you obtaining the window
handle to send keys to? Do you get an error?

jeff
 
I use FindWindow and BringWindowToTop APIs to activate the window. Then, I
send keys as if the user was typing something. It it working for any local
application, but it doesn't work on Remote Desktop. There is no error; the
keys are just not passed. However, in some circonstances something happens
on the Remote Desktop. For example, I send 2 tabs, the first tab closes the
window (and an error is then displayed). The 2nd tab closes that error
message. That makes no sense lol. The only action I've been able to do is
canceling (sometimes). I don't know why.

Etienne
 
So it took 4 responses to answer my original question?

You've successfully then brought the Citrix window to focus. But then, what
has the focus in the remote window? Can you be guaranteed to have your
remote app be the focus in the session window? FindWindow used again
doesn't work inside a terminal session.

You need to rethink the architecture, in my opinion. Be nice, and I (we) can
help.

So you are paid to USE a system? Do they pay you by the hour? Does the
app log you in, and keep track of your time? Define "system"

Do you want this to work? (that is a simple yes/no question). Often
accepting answers requires a paradigm shift.

There is something definitely missing here.

Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top