在 C# 中模拟 Winkey 行为
我想模拟按 WinKey + 数字在任务栏中的应用程序之间切换。
有没有办法用托管代码来做到这一点,或者我必须使用 win32 API? 我尝试使用 SendKeys.SendWait 进行某些操作类似于“^{TAB}2”,但这会在中写入 1 开始菜单字段。 “(^{TAB})1”也不起作用。
如何将 WinKey 传递给 SendKeys?
I want to simulate pressing WinKey + digit to switch between to application in taskbar.
Is there a way to do this with managed code or I have to use win32 API?
I tried to use SendKeys.SendWait with something like "^{TAB}2" but this writes 1 in the
field of Start Menu. Nor does "(^{TAB})1" works.
How can I pass WinKey to SendKeys?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的研究表明,如果不使用像 AutoHotKey 这样的第三方工具,您就无法在不使用 win32 API 的情况下真正模拟 Windows 组合键快捷键。
不过这篇文章展示了 win32 API 的一个非常简单的实现。只需创建一个类并在需要时调用它即可。最好的部分是,它可以通过传入 Keys 枚举值
My research showed that without the use of third party tools like AutoHotKey you can't really simulate the windows key combination shortcuts without the use of the win32 API.
This post showed a very easy implementation of the win32 API though. Just create a class and call on it when you need to. Best part is that it works using any key you want by passing in a Keys enum value