简体   繁体   English

Citrix Xenapp-Sendkeys

[英]Citrix Xenapp - Sendkeys

I have been trying (with limited resources) to use VBScript and VBA commands to send keyboard functions to a remote citrix terminal. 我一直在尝试(使用有限的资源)使用VBScript和VBA命令将键盘功能发送到远程citrix终端。 - This, as I've discovered is a known restriction and I've found various articles which give an alternative method via C++ and scancodes to overcome the restriction. -正如我发现的那样,这是一个已知的限制,并且我发现了许多文章,这些文章通过C ++和扫描代码提供了一种替代方法来克服该限制。

The main issue is, I don't have access to C++. 主要问题是,我无权使用C ++。

  • Is there a solution that will allow this with VBScripts and/or VBA? 是否有解决方案可以通过VBScripts和/或VBA做到这一点?

I've considered many options, including using the windows virtual keyboard (this didn't work) and installing a virtual keyboard driver in windows (well out of my depth). 我考虑过很多选择,包括使用Windows虚拟键盘(这不起作用)和在Windows中安装虚拟键盘驱动程序(超出我的深度)。

Here is one of the articles which discuses the scancodes, using C++: 这是使用C ++讨论扫描代码的文章之一:

http://www.codeproject.com/Tips/310817/SendKeys-using-ScanCodes-to-Citrix http://www.codeproject.com/Tips/310817/SendKeys-using-ScanCodes-to-Citrix

I am at a loss and anyone who can help would be a super hero...If a super heroes' main appeal was to be a geek god. 我很茫然,任何能帮助的人都会成为超级英雄...如果超级英雄的主要吸引力是成为一个怪胎之神。 :) :)

Any help is appreciated!!! 任何帮助表示赞赏!!!

Cheers. 干杯。

****UPDATE**** **** ****更新

Hello, 你好,

I've done a little more digging... 我做了更多的挖掘工作...

...The Citrix ICA Client terminal window isn't receiving the VBScript sendkeys commands but if I manually press alt in the terminal after executing the script (with a 2 second pause), for example: ... Citrix ICA Client终端窗口未接收到VBScript sendkeys命令,但是如果我在执行脚本(暂停2秒)后手动在终端中按alt,例如:

*Set objShell = WScript.CreateObject("WScript.Shell")
WScript.Sleep 2000
objShell.SendKeys ("e")
objShell.SendKeys "(P)"*

The above can access the 'file', 'edit', etc menu options on the tool bar within the terminal window. 以上内容可以访问终端窗口中工具栏上的“文件”,“编辑”等菜单选项。

This to me suggests that the issue isn't a privilege issue and I'd think that there is perhaps hope yet for the sendkeys method? 在我看来,这不是特权问题,我认为sendkeys方法可能还存在希望吗?

Having looked further into this, there is some documentation re: ini file settings on the Citrix site with regards to Citrix ICA clients. 对此进行了进一步研究之后,在Citrix站点上有一些关于Citrix ICA客户端的ini文件设置:

One of the articles can be found below: 可以在下面找到其中一篇文章:

http://support.citrix.com/article/CTX129166 http://support.citrix.com/article/CTX129166

I've had a play around and there does seem to be a few ini files which list keyboard mappings, DLL files, virtual key passthrough as well? 我玩得很开心,似乎还有一些ini文件列出了键盘映射,DLL文件,虚拟键传递以及?

One of the sections of the 'module' ini file contained the following: “模块” ini文件的其中一个部分包含以下内容:

[KeyboardLayout]
(User Profile)=0x00000000
(Server Default)=0xFFFFFFFF

There were other codes, including various languages, British, US-International etc. 还有其他代码,包括各种语言,英国,美国国际等。

This was then followed by a list of DLL codes eg: 然后是DLL代码列表,例如:

kbduk.dll=0x00000809

And finally, Language IDs, eg: 最后是语言ID,例如:

eng=0x00000809

I am guessing (hoping) that there would be a way to amend the ini settings that will allow for the sendkeys to be received in the terminal fields and not just the toolbar menus. 我猜(希望),将有一种方法可以修改ini设置,该设置将允许在终端字段中接收到sendkey,而不仅仅是工具栏菜单。

As before, any help is appreciated....I am slowly going insane over this one!!! 和以前一样,我们将不胜感激。...我对此感到很疯狂!!!

Cheers! 干杯!

Bullet pointed solution 子弹头解决方案

What is required: 需要什么:

On screen keyboard (OSK.EXE) windows app VBScript (not essential but preferred by me as controling script) VBA (to move the mouse) 在屏幕键盘(OSK.EXE)上,Windows应用程序VBScript(不是必需的,但我作为控制脚本首选)VBA(移动鼠标)

  1. Set OSK to receive 'hover' commands 将OSK设置为接收“悬停”命令
  2. Set VBA code to move mouse to specific co-ordinates 设置VBA代码以将鼠标移至特定坐标
  3. Use VBScript to control when specific subs from the VBA XLS file are run. 使用VBScript控制何时运行VBA XLS文件中的特定子程序。 - This can be set to run in the background without the requirement for manual opening of the file etc. -可以将其设置为在后台运行,而无需手动打开文件等。
  4. Set Citrix Xenapp terminal as active window and key presses should send! 将Citrix Xenapp终端设置为活动窗口,然后应该发送按键!

Cheers all! 欢呼大家!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM