By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,658 Members | 1,519 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,658 IT Pros & Developers. It's quick & easy.

Send keys to Remote Desktop

P: n/a
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
Jul 21 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
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
"Etienne Charland" <mysteryx93 at hotmail> wrote in message
news:HL********************@b2b2c.ca...
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

Jul 21 '05 #2

P: n/a
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.

"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
news:ut*************@TK2MSFTNGP09.phx.gbl...
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
"Etienne Charland" <mysteryx93 at hotmail> wrote in message
news:HL********************@b2b2c.ca...
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


Jul 21 '05 #3

P: n/a
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

"Etienne Charland" <mysteryx93 at hotmail> wrote in message
news:IN********************@b2b2c.ca...
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.

"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
news:ut*************@TK2MSFTNGP09.phx.gbl...
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
"Etienne Charland" <mysteryx93 at hotmail> wrote in message
news:HL********************@b2b2c.ca...
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



Jul 21 '05 #4

P: n/a
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

"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
news:eB*************@TK2MSFTNGP10.phx.gbl...
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

"Etienne Charland" <mysteryx93 at hotmail> wrote in message
news:IN********************@b2b2c.ca...
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.

"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
news:ut*************@TK2MSFTNGP09.phx.gbl...
> 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
> "Etienne Charland" <mysteryx93 at hotmail> wrote in message
> news:HL********************@b2b2c.ca...
>> 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
>>
>>
>
>



Jul 21 '05 #5

P: n/a
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

"Etienne Charland" <mysteryx93 at hotmail> wrote in message
news:Md********************@b2b2c.ca...
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

"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
news:eB*************@TK2MSFTNGP10.phx.gbl...
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

"Etienne Charland" <mysteryx93 at hotmail> wrote in message
news:IN********************@b2b2c.ca...
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.

"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
news:ut*************@TK2MSFTNGP09.phx.gbl...
> 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
> "Etienne Charland" <mysteryx93 at hotmail> wrote in message
> news:HL********************@b2b2c.ca...
>> 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
>>
>>
>
>



Jul 21 '05 #6

P: n/a
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

"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
news:e2**************@TK2MSFTNGP11.phx.gbl...
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

"Etienne Charland" <mysteryx93 at hotmail> wrote in message
news:Md********************@b2b2c.ca...
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

"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
news:eB*************@TK2MSFTNGP10.phx.gbl...
> 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
>
> "Etienne Charland" <mysteryx93 at hotmail> wrote in message
> news:IN********************@b2b2c.ca...
>> 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.
>>
>> "Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
>> news:ut*************@TK2MSFTNGP09.phx.gbl...
>> > 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
>> > "Etienne Charland" <mysteryx93 at hotmail> wrote in message
>> > news:HL********************@b2b2c.ca...
>> >> 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
>> >>
>> >>
>> >
>> >
>>
>>
>
>



Jul 21 '05 #7

P: n/a
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
"Etienne Charland" <mysteryx93 at hotmail> wrote in message
news:9q********************@b2b2c.ca...
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

"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
news:e2**************@TK2MSFTNGP11.phx.gbl...
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

"Etienne Charland" <mysteryx93 at hotmail> wrote in message
news:Md********************@b2b2c.ca...
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

"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
news:eB*************@TK2MSFTNGP10.phx.gbl...
> 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
>
> "Etienne Charland" <mysteryx93 at hotmail> wrote in message
> news:IN********************@b2b2c.ca...
>> 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.
>>
>> "Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
>> news:ut*************@TK2MSFTNGP09.phx.gbl...
>> > 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
>> > "Etienne Charland" <mysteryx93 at hotmail> wrote in message
>> > news:HL********************@b2b2c.ca...
>> >> 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
>> >>
>> >>
>> >
>> >
>>
>>
>
>



Jul 21 '05 #8

P: n/a
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

"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
news:eS***************@TK2MSFTNGP11.phx.gbl...
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
"Etienne Charland" <mysteryx93 at hotmail> wrote in message
news:9q********************@b2b2c.ca...
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

"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
news:e2**************@TK2MSFTNGP11.phx.gbl...
> 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
>
> "Etienne Charland" <mysteryx93 at hotmail> wrote in message
> news:Md********************@b2b2c.ca...
>> 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
>>
>> "Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
>> news:eB*************@TK2MSFTNGP10.phx.gbl...
>> > 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
>> >
>> > "Etienne Charland" <mysteryx93 at hotmail> wrote in message
>> > news:IN********************@b2b2c.ca...
>> >> 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.
>> >>
>> >> "Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
>> >> news:ut*************@TK2MSFTNGP09.phx.gbl...
>> >> > 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
>> >> > "Etienne Charland" <mysteryx93 at hotmail> wrote in message
>> >> > news:HL********************@b2b2c.ca...
>> >> >> 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
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> >>
>> >
>> >
>>
>>
>
>



Jul 21 '05 #9

P: n/a
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

"Etienne Charland" <mysteryx93 at hotmail> wrote in message
news:j-********************@b2b2c.ca...
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

"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
news:eS***************@TK2MSFTNGP11.phx.gbl...
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
"Etienne Charland" <mysteryx93 at hotmail> wrote in message
news:9q********************@b2b2c.ca...
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

"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
news:e2**************@TK2MSFTNGP11.phx.gbl...
> 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
>
> "Etienne Charland" <mysteryx93 at hotmail> wrote in message
> news:Md********************@b2b2c.ca...
>> 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
>>
>> "Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
>> news:eB*************@TK2MSFTNGP10.phx.gbl...
>> > 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
>> >
>> > "Etienne Charland" <mysteryx93 at hotmail> wrote in message
>> > news:IN********************@b2b2c.ca...
>> >> 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.
>> >>
>> >> "Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message >> >> news:ut*************@TK2MSFTNGP09.phx.gbl...
>> >> > 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
>> >> > "Etienne Charland" <mysteryx93 at hotmail> wrote in message
>> >> > news:HL********************@b2b2c.ca...
>> >> >> 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
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> >>
>> >
>> >
>>
>>
>
>



Jul 21 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.