另一个SendKeys

编程入门 行业动态 更新时间:2024-10-24 18:20:19
本文介绍了另一个SendKeys - 用于Citrix。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

您好, 有谁知道发送密钥的其他方式。我在Citrix上使用SendKeys.Send({ENTER} {TAB})时遇到了问题(它类似于DOS基本键控/输入,连接到服务器)。不知何故,像输入和标签这样的特殊键不起作用,但是[AZ] [0-9]很好。 请帮助。 谢谢。 BTW,发现这篇文章但参考文献遗失,很难找到互联网 SendKeys使用ScanCodes到Citrix [ ^ ]

推荐答案

SendKeys 由于多种原因而非常糟糕。在Windows中模拟输入事件的真正通用方法是 SendInput : msdn.microsoft/en-us/library/windows/desktop/ms646310%28v=vs.85% 29.aspx [ ^ ]。 您可以通过P / Invoke使用它,这已经为您完成了:www.pinvoke/default.aspx/user32.sendinput [ ^ ]。 并向您发出警告:尽量远离技术滥用。需要模拟输入的情况非常少见;玩键盘(键盘/鼠标)宏就是其中之一;另一个应用程序可能是UI测试工具。例如,不应在UI开发中使用输入模拟。
-SA
SendKeys is a pretty bad thing, by a number of reasons. The really universal ways to simulate input events in Windows is SendInput: msdn.microsoft/en-us/library/windows/desktop/ms646310%28v=vs.85%29.aspx[^]. You can use it via P/Invoke, which is already done for you: www.pinvoke/default.aspx/user32.sendinput[^]. And a word of warning for you: try to stay away from technology abuse. The cases when you need to simulate input are quite rare; playing keyboard (keyboard/mouse) macro is one of them; another application could be UI testing tools. Simulation of input should not be used in UI development, for example.
—SA

更多推荐

另一个SendKeys

本文发布于:2023-11-24 10:28:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1624839.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:SendKeys

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!