A program which runs on a Citrix server must drive a program running on a
local machine which in turn drives the sound card. The application achieve
that goal through the use of sockets and performs very well.
But due to the difficulty (for some users of local machines) of configuring
routers and/or firewalls correctly, we often are not able to achieve that
goal when we use sockets.
The application is used throughout North America, so we simply cannot
configure every client.
The new idea here is to have the program running on Citrix control the
program running on the local machine through a series of fake depressed
keyboard keys that the program running on the local machine would intercept
and act accordingly.
First step.
I have written a global keyboard hook program that intercepts all the keys
pressed on the keyboard whether those keys were pressed when the said
program would have the focus or not.
To test that program, I have started it and opened a notepad document. I
made sure that every key that was pressed in the notepad document got first
intercepted by that program.
Result: success.
Second step.
I started that program on my local machine and opened a notepad document on
a Citrix server machine (CTX-3). I made sure that every key that was
pressed in the notepad document was still getting intercepted by the
keyboard hook program running on the local machine.
Result: success.
Third step.
Since Delphi doesn't provide us with that functionnality, I had to write a
program that made Windows believe that several keys on the keyboard were
being pressed (which I will eventually have to do).
I started the keyboard hook program on my local machine, started the fake
keyboard program on my local machine and made sure that the keyboard hook
program could intercept every faked keys pressed by the fake keyboard
program.
Result: success.
Fourth step.
I transfered the fake keyboard program on a Citrix server and, after having
started my keyboard hook program on my local machine, ran the fake keyboard
program on the Citrix server.
I wanted to make sure that the keyboard hook program could still intercept
every faked keys pressed by the fake keyboard program running on Citrix.
Result: failure
I think I know why. The fake keyboard program runs on the Citrix Server
Machine and sends messages to Windows on that machine and not to Windows on
the client machine.
My keyboard hook program was working well on the Citrix Server when I tested
it with Notepad probably because both Windows were sharing the same
keyboard, so both were receiving messages from the keyboard.
My question now! Does somebody have another idea????