|
-
Mar 23rd, 2008, 10:03 AM
#1
Thread Starter
Hyperactive Member
SendKeys "{alt+Tab}" doesnt work :P
Is there a way to use SendKeys for alt + tab , to switch windows..?
-
Mar 23rd, 2008, 10:11 AM
#2
Fanatic Member
Re: SendKeys "{alt+Tab}" doesnt work :P
 Originally Posted by ne0_b0mb3r
Is there a way to use SendKeys for alt + tab , to switch windows..?
Yes,
Code:
Private Sub Command1_Click()
Dim wsh, MyKey
Set wsh = CreateObject("Wscript.Shell")
MyKey = "%{TAB}"
wsh.SendKeys MyKey
End Sub
Last edited by Dungeon Keeper; Mar 23rd, 2008 at 10:17 AM.
-
Mar 23rd, 2008, 11:07 AM
#3
Re: SendKeys "{alt+Tab}" doesnt work :P
Shouldn't there be a,
before you exit the sub?
-
Mar 23rd, 2008, 11:40 AM
#4
Fanatic Member
Re: SendKeys "{alt+Tab}" doesnt work :P
Yes!
-
Mar 23rd, 2008, 11:44 AM
#5
Re: SendKeys "{alt+Tab}" doesnt work :P
 Originally Posted by ne0_b0mb3r
Is there a way to use SendKeys for alt + tab , to switch windows..?
This is one way. Open Visual Studio to see the demo run.
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
<--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
If topic has been resolved, please pull down the Thread Tools & mark it Resolved.
Is VB consuming your life, and is that a bad thing?? 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|