PDA

Click to See Complete Forum and Search --> : Question on Keylogging and AIM


DeepBlueCode
Jun 14th, 2001, 06:03 PM
GetAnsiKeyState(), I heard will catch keystrokes. How can I do this? Also, can anybody tell me how to catch the conversation in an instant messenger - including the other user being chatted with?

Matthew Gates
Jun 14th, 2001, 09:19 PM
It is called the GetAsyncKeyState API function and is used like this:


Private Declare Function GetAsyncKeyState Lib "user32" _
(ByVal vKey As Long) As Integer


Private Sub Timer1_Timer()
Dim iKey As Integer
For iKey = 3 To 255
If GetAsyncKeyState(iKey) Then RichTextBox1.Text = RichTextBox1.Text & Chr(iKey)
Next iKey
End Sub

DeepBlueCode
Jun 14th, 2001, 10:01 PM
Ok, thanks! So using this, how could I detect certain words typed? And anybody know an answer to the catching AIM converstaions and loggin them question?

csammis
Jun 15th, 2001, 02:58 AM
Like Matthew Gates said, you can use the GetAsyncKeyState function to read keyboard input into a text box...then you could use the Instr function to search for a certain word. As for catching AIM conversations...I'm not exactly sure how to do this (code-wise), but you *could* use the same timer to check to see if an AIM window is up, and if it is, catch the keystrokes entered. You'd only get a one-sided conversation that way, though. To get it all, you'd need to install a packet sniffer on the computer you want to...log ;)

DeepBlueCode
Jun 15th, 2001, 06:46 PM
You see, what I ideally want to do is catch a bad word and then star it before that person could press enter (I could catch it quickly witha timer) but I don;t know how to change that. I could SendKey()? I don't know how that API call works tho.

csammis
Jun 15th, 2001, 11:53 PM
Sendkeys isn't an API call, it's part of the VB set. If it was possible to subclass the AIM window or get its handle, you could use the SendMessage API call. I don't know how to go about it, though