Vista 中的 C# Sendkeys

发布于 2024-09-26 18:25:22 字数 281 浏览 0 评论 0原文

我正在用 C# 编写一个宏程序,它使用 SendKeys.Send(Wait) 并且在 Windows XP 中运行良好。

大多数人都知道在 Vista(32 位)或更高版本中使用 sendkeys 会导致问题,但我的似乎有点奇怪:

使用时: SendKeys.Send("B"); - 它没有任何作用。

使用 SendKeys.SendWait("B"); 时 - 它在停止之前发送大约 10 个 B。

有谁知道现在该怎么办,因为这不会留下很多其他选择。

提前致谢!

I was working on a macro program in C#, which used SendKeys.Send(Wait) and worked fine in Windows XP.

Most people know that using sendkeys in Vista (32-bit) or above causes problems, but mine seems a little strange:

When using: SendKeys.Send("B");
- It doesn't do anything.

When using SendKeys.SendWait("B");
- It sends about 10 B's before it stops.

Does anyone know what to do now, because this doesn't leave alot of other options.

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

别低头,皇冠会掉 2024-10-03 18:25:22

您使用的是哪个版本的 .Net?请参阅有关在 Vista 中使用 SendKeys 的说明,网址为 SendKeys 类

您还可以尝试使用 Windows 输入模拟器 作为替代方案。它也有更强大的API。

Which version of .Net are you using? See the note about using SendKeys in Vista at SendKeys Class

You can also try using Windows Input Simulator as an alternative. It has much more powerful api too.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文