Results 1 to 2 of 2

Thread: GetAsyncKeyState (mismatch error)

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2008
    Posts
    113

    GetAsyncKeyState (mismatch error)

    I get a mismatch error when I try to do this:

    Code:
    Private Sub Timer1_Timer()
    If GetAsyncKeyState(vbKeyControl) And GetAsyncKeyState(vbKey1) Then
    'do stuff
    End If
    End Sub
    Why do you think I keep getting this error? Is there an alternative code I can use?

  2. #2
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: GetAsyncKeyState (mismatch error)

    Is the API declared correctly?

    No error here using,

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

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