wpf 模拟 Alt + Tab 键按下

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18165342/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 09:25:04  来源:igfitidea点击:

Simulating Alt + Tab Key Press

c#.netwpfvb.netalt-tab

提问by Elmo

I have tried to simulate Alt+ Tabkey press using SendInput, keybd_event, SendMessageand SendKeys.Sendbut none of them work. All other key presses work but only Alt+ Tabdoesn't work.

我试图模仿Alt+Tab使用按键SendInputkeybd_eventSendMessageSendKeys.Send,但他们没有工作。所有其他按键都有效,但只有Alt+Tab无效。

Can anyone tell me how do I open the Alt+ TabTask Switcher programatically?

谁能告诉我如何以编程方式打开Alt+Tab任务切换器?

回答by Rahul Tripathi

You can use SendKeysclass and it's Sendmethod

您可以使用SendKeys类及其Send方法