Send Keystroke to another Application

  • Thread starter Stefan Reinmers
  • Start date
S

Stefan Reinmers

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_event" ( _
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
 
A

Armin Zingler

Stefan Reinmers said:
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_event" ( _ 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top