Is there a way to use SendKeys for alt + tab , to switch windows..?
Printable View
Is there a way to use SendKeys for alt + tab , to switch windows..?
Quote:
Originally Posted by ne0_b0mb3r
Yes,
Code:Private Sub Command1_Click()
Dim wsh, MyKey
Set wsh = CreateObject("Wscript.Shell")
MyKey = "%{TAB}"
wsh.SendKeys MyKey
End Sub
Shouldn't there be a,
before you exit the sub?Code:Set wsh = Nothing
Yes! :)
This is one way. Open Visual Studio to see the demo run.Quote:
Originally Posted by ne0_b0mb3r
Code:Option Explicit
Dim i%
Private Sub Command1_Click()
i% = 0
Timer1.Enabled = Not Timer1.Enabled = True
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
Timer1.Interval = 2000
AppActivate "MSDN Library Visual Studio 6.0", 1
End Sub
Private Sub Timer1_Timer()
i% = i% + 1
Me.Caption = "Alt + Tab " & i% & " Times"
If i% >= 8 Then Timer1.Enabled = False
SendKeys "%{TAB}"
End Sub