Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to perform a hold ALT+TAB sendkey event in C#

I am trying to use a sendkey event that holds the ALT key and then presses the TAB key. How do you perform that action, I've tried many variations but I can't seem to find the answer, thanks.

like image 528
mendez Avatar asked Aug 05 '11 04:08

mendez


2 Answers

After going through the MSDN documentation page I came up with this and it seems to be working just fine for me:

SendKeys.Send("%{Tab}");

like image 178
Ziad Avatar answered Nov 03 '22 00:11

Ziad


[Windows.Forms.Sendkeys]::SendWait("%{Alt Down}")

[Windows.Forms.Sendkeys]::SendWait("%{TAB}")

[Windows.Forms.Sendkeys]::SendWait("%{Alt Up}")

Works in Powershell for me! Thanks for tips ;)

like image 3
Pepa Avatar answered Nov 02 '22 23:11

Pepa