简体   繁体   English

SendKeys操作系统限制

[英]SendKeys Operating System Limitations

Are there Operating System related intricacies with the SendKeys vbScript method? SendKeys vbScript方法是否存在与操作系统相关的复杂性? I am upgrading from a GE Cimplicity 4 project on a Windows XP computer to GE Cimplicity 10 project on a Windows Server 2012 R2 Virtual Machine. 我正在从Windows XP计算机上的GE Cimplicity 4项目升级到Windows Server 2012 R2虚拟机上的GE Cimplicity 10项目。

The SendKeys method was used to change tab focus on a screen opening. SendKeys方法用于在屏幕打开时更改选项卡焦点。 The script now indefinitely freezes no matter what key is sent using SendKeys. 现在,无论使用SendKeys发送什么密钥,脚本都会无限期冻结。 Has anyone encountered any SendKeys freezes after Operating System changes before? 在更改操作系统之前,是否有人遇到过任何冻结的SendKeys?

SendKeys “{TAB}”, 1

Documentation I have referenced so far: 到目前为止我引用的文档:

http://proscada.ru/cimplicity/bce-lrf/lrfs/sendkeys.statement.htm http://proscada.ru/cimplicity/bce-lrf/lrfs/sendkeys.statement.htm

https://social.technet.microsoft.com/wiki/contents/articles/5169.vbscript-sendkeys-method.aspx https://social.technet.microsoft.com/wiki/contents/articles/5169.vbscript-sendkeys-method.aspx

 SendKeys "{TAB}1"

字符串(即文本)必须用引号引起来。

The issue was narrowed down to a newer Microsoft Security feature called "User Access Control (UAC)" that started with Windows Vista. 该问题已缩小到Windows Vista开始的一项新的Microsoft安全功能,称为“用户访问控制(UAC)”。 The feature needs to be turned off in order to get the sendKeys command to work properly with Cimplicity. 需要关闭该功能才能使sendKeys命令与Cimplicity一起正常使用。

As for sendKeys performance outside of Cimplicity, sendKeys has a few different implementations depending on timing and Operating System. 至于Cimplicity之外的sendKeys性能,取决于时间和操作系统,sendKeys有几种不同的实现。 To force sendKeys to use only one implementation to get consistent timing (if consistency is an issue), you can update the app.config file to force an implementation by adding: 要强制sendKeys仅使用一个实现来获得一致的计时(如果一致性是一个问题),可以通过添加以下内容来更新app.config文件以强制实现:

<appSettings>
    <add key="SendKeys" value="SendInput"/>
</appSettings>

Reference: 参考:

https://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.send(v=vs.110).aspx https://msdn.microsoft.com/zh-CN/library/system.windows.forms.sendkeys.send(v=vs.110).aspx

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

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