Results 1 to 2 of 2

Thread: keyboard control

  1. #1

    Thread Starter
    Banned
    Join Date
    Aug 2016
    Location
    https://t.me/pump_upp
    Posts
    30

    Question keyboard control

    Hi guys,
    Im beginner to vb6. I know to control the key press events within a textbox, rtb etc and that works fine within vb6 project.
    My query is that how can we control/change the keypress events outside the vb like in word, notepad, wordpad etc.

    Thanks in advance.

  2. #2
    PowerPoster
    Join Date
    Sep 2006
    Location
    Egypt
    Posts
    2,579

    Re: keyboard control

    The simplest way is using AppActivate and SendKeys
    vb Code:
    1. Private Sub Command1_Click()
    2.     ' Use this if you know the title of the app you want to send to
    3.     AppActivate "untitled - notepad"
    4.     SendKeys "Hello!{enter}"
    5.    
    6. '    ' Use this to send to any foreground app (manually activated by you)
    7. '    Me.WindowState = vbMinimized
    8. '    SendKeys "Hello!{enter}"
    9. '    Me.WindowState = vbNormal
    10. End Sub



Tags for this Thread

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