Send Keystroke to another Application

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Stefan Reinmers

    Send Keystroke to another Application

    Hi there, how can i send keystrokes (with vb.net ! )when i not wanna use
    sendkeys ?
    i have tryed
    Private Declare Sub keybd_event Lib "user32" Alias "keybd_even t" ( _
    ByVal bVk As Byte, _
    ByVal bScan As Byte, _
    ByVal dwFlags As Long, _
    ByVal dwExtraInfo As Long)

    keybd_event(65, 0, 0, 0)
    keybd_event(65, 0, KEYEVENTF_KEYUP , 0)

    but i got an PInvoke error.
    when i try to sendmessage can i here send for example
    strg + a
    or
    alt + l
    ??
    greetings


  • Armin Zingler

    #2
    Re: Send Keystroke to another Application

    "Stefan Reinmers" <sreinmers@gmai l.comschrieb
    Hi there, how can i send keystrokes (with vb.net ! )when i not wanna
    use sendkeys ?
    i have tryed
    Private Declare Sub keybd_event Lib "user32" Alias
    "keybd_even t" ( _ ByVal bVk As Byte, _
    ByVal bScan As Byte, _
    ByVal dwFlags As Long, _
    ByVal dwExtraInfo As Long)
    >
    keybd_event(65, 0, 0, 0)
    keybd_event(65, 0, KEYEVENTF_KEYUP , 0)
    >
    but i got an PInvoke error.
    when i try to sendmessage can i here send for example
    strg + a
    or
    alt + l
    ??
    greetings
    As I have told you already in the German group, the declaration is still
    wrong, and the MSDN lib says that the function has been replaced by the
    SendInput function, however it can still be used - if declared
    correctly.


    Armin

    Comment

    Working...