|
-
May 27th, 2004, 04:39 PM
#1
Thread Starter
Fanatic Member
appActivate and sendkeys to a simple telnet window?
As simple as this:
VB Code:
Dim telnet
telnet = Shell("telnet.exe", vbNormalFocus)
AppActivate telnet, True
SendKeys "open", True
but why it doesn't work?
-
May 30th, 2004, 08:55 AM
#2
-
May 30th, 2004, 10:44 AM
#3
Frenzied Member
-
May 30th, 2004, 07:14 PM
#4
Thread Starter
Fanatic Member
The problem is that i can't even run that, it gives an error in
AppActivate telnet, True - invalid procedure call or argument
i'v tryed to using just shell("telnet.exe") and then sendkeys but the telnet window didn't received any key.
-
May 31st, 2004, 03:07 PM
#5
Lively Member
Hey I got it to work just fine.
VB Code:
Private Sub Command1_Click()
AppActivate telnet
SendKeys "Hi" & vbCrLf
End Sub
Private Sub Form_Load()
telnet = Shell("telnet.exe", vbNormalFocus)
End Sub
The vbCrLf in there is the enter key in case you didn't know.
-
Jun 1st, 2004, 11:29 AM
#6
Thread Starter
Fanatic Member
invalid procedure call or argument
on AppActivate telnet
-
Jun 1st, 2004, 12:16 PM
#7
Lively Member
In my code, 'Telnet' needs to be in a higher scope. If you had tried to run it as i had posted it before, 'Telnet' would have a value of zero in the Command1_Click() routine. Maybe that's your problem, I don't know. But it works when I try it.
VB Code:
Option Explicit
Dim Telnet As Double
Private Sub Command1_Click()
AppActivate Telnet
SendKeys "Hi" & vbCrLf
End Sub
Private Sub Form_Load()
Telnet = Shell("telnet.exe", vbNormalFocus)
End Sub
-
Jun 11th, 2004, 02:16 PM
#8
Thread Starter
Fanatic Member
well...this didn't worked for me, it's strange but it didn't work
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
|