Results 1 to 3 of 3

Thread: mouseclicks and webbrowser control

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2000
    Posts
    16

    Question

    Hello,

    I'm doing a little project in which I have to monitor behaviour of users, when they are browsing through a nuber of (offline) webpages. I thought I could use the MS webbrowser control, for its ease of use. But it seems that this control is not able to catch mouseclicks or keypresses.
    Has anyone a solution on how to monitor this?

    Thanks,

    Leon

  2. #2
    Guest
    Use the GetAsyncKeyState API function.

    Code:
    Declare Function GetAsyncKeyState Lib "user32.dll" _
    (ByVal vKey As Long) As Integer
    
    Private Sub Timer1_Timer()
         'Keypresses:
         If GetAsyncKeyState(vbKeyA) Then Msgbox "A"
         If GetAsyncKeyState(vbKeyB) Then Msgbox "B"
         If GetAsyncKeyState(vbKeyC) Then Msgbox "C"
         '.....
         'Or catch any:
         'Dim iKey As Integer
         'For iKey = 3 to 255
         'Print iKey
         'Next iKey
         'And for the mouse clicks:
         If GetAsyncKeyState(vbLeftButton) Then Msgbox "Left"
         If GetAsyncKeyState(vbMiddleButton) Then Msgbox "Middle"
         If GetAsyncKeyState(vbRightButton) Then Msgbox "Right"
    End Sub

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 2000
    Posts
    16
    Thanks,

    Altough it shall not win a price for beauty (I dislike the use of timers). But apart from that it looks easy and straightforward.

    Leon

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