Results 1 to 8 of 8

Thread: appActivate and sendkeys to a simple telnet window?

  1. #1

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972

    appActivate and sendkeys to a simple telnet window?

    As simple as this:

    VB Code:
    1. Dim telnet
    2. telnet = Shell("telnet.exe", vbNormalFocus)
    3. AppActivate telnet, True
    4. SendKeys "open", True

    but why it doesn't work?
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

  2. #2
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    Doesn't work is very vague... What is the problem? It doesn't get activated? It doesn't send the keys?


    Has someone helped you? Then you can Rate their helpful post.

  3. #3
    Frenzied Member Spajeoly's Avatar
    Join Date
    Mar 2003
    Location
    Utah
    Posts
    1,068
    You know, for kids!

  4. #4

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972
    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.
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

  5. #5
    Lively Member Bootking's Avatar
    Join Date
    Mar 2003
    Location
    Marquette University
    Posts
    90
    Hey I got it to work just fine.

    VB Code:
    1. Private Sub Command1_Click()
    2.     AppActivate telnet
    3.     SendKeys "Hi" & vbCrLf
    4. End Sub
    5.  
    6. Private Sub Form_Load()
    7.     telnet = Shell("telnet.exe", vbNormalFocus)
    8. End Sub

    The vbCrLf in there is the enter key in case you didn't know.
    Check out my band's website!
    Walter Walker Band

  6. #6

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972
    invalid procedure call or argument
    on AppActivate telnet
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

  7. #7
    Lively Member Bootking's Avatar
    Join Date
    Mar 2003
    Location
    Marquette University
    Posts
    90
    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:
    1. Option Explicit
    2.  
    3. Dim Telnet As Double
    4.  
    5. Private Sub Command1_Click()
    6.     AppActivate Telnet
    7.     SendKeys "Hi" & vbCrLf
    8. End Sub
    9.  
    10. Private Sub Form_Load()
    11.     Telnet = Shell("telnet.exe", vbNormalFocus)
    12. End Sub
    Check out my band's website!
    Walter Walker Band

  8. #8

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972
    well...this didn't worked for me, it's strange but it didn't work
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width