Record and Replay another applications keystrokes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have some testing to do and I need to put a whole set of data in I want to
Record and replay in a loop keystrokes.

An idea
 
Zak,

Can this sample I made 2 weeks ago do something for you (Look that the
button should be than an array of characters, that is only for the sample)

\\\
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim mypress As New KeyPressEventArgs("D"c)
TextBox1_KeyPress(sender, mypress)
End Sub
Private Sub TextBox1_KeyPress(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles _
TextBox1.KeyPress
MessageBox.Show("I am clicked by key " & _
e.KeyChar & " in " & _
DirectCast(sender, Control).Name)
End Sub
///

I hope this helps?

Cor
 
* =?Utf-8?B?emFr?= said:
I have some testing to do and I need to put a whole set of data in I want to
Record and replay in a loop keystrokes.

You'll need a keyboard hook to capture these keystrokes system-wide:

Article on keyboard hooks:

<URL:http://www.developer.com/net/net/article.php/11087_2193301_1/>

Documentation on hooks:

<URL:http://msdn.microsoft.com/library/en-us/dnwui/html/msdn_hooks32.asp>
<URL:http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/hooks.asp>

Then you can use p/invoke on 'keybd_event' to send the keystrokes.
 
Back
Top