-
Hello, i have a problem,
Well I can't get this program to get focus.
I Put it in the StartUP so when i start the computer up it will start the program, and the program is to Make it so i don't have to manullay connect to,
Dial up network, it will just do it, and i send the Keys,
Using SendKey and that works but the rpoblem is, i have to make it so when i send the key "ENTER"{enter} it will press connect.
heres the code:
Code:
Private Sub Form_Load()
Dim X
'"ConnectionName" is the name under the icon in Dial-up Networking
X = Shell("rundll32.exe rnaui.dll,RnaDial " & "Keystone Internet Access", 1)
DoEvents
'You can type in your password before the { below.
SendKeys "CorySs {enter}", True
DoEvents
Unload Me
End
End Sub
IF anyone has the solution please post it!
thanks for listening :D
PS: with this code it just pops up the Dial Up connection and it makes this noise because its not on Focus, and it never hits enter, but it pops it up. i hope i didn't confuse anyone! :confused:
-
Hi,
You need to activate the app (give focus) before you can send keys. Try this:
Code:
Private Sub Form_Load()
Dim X
'"ConnectionName" is the name under the icon in Dial-up Networking
X = Shell("rundll32.exe rnaui.dll,RnaDial " & "Keystone Internet Access", 1)
AppActivate X 'Give the app focus
DoEvents
'You can type in your password before the { below.
SendKeys "CorySs {enter}", True
DoEvents
Unload Me
End
End Sub
Hope this helps
Shaun