Results 1 to 4 of 4

Thread: Mouse

  1. #1

    Thread Starter
    Lively Member TB's Avatar
    Join Date
    Feb 2001
    Location
    Austria
    Posts
    106

    Question Mouse

    Hello!
    How can I determine If a mouse button is pressed OUTSIDE the form?
    Thank you for any help.
    mojo

  2. #2
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    You will need to install a global hook that monitors the mouse (the hook procedure has to be installed in a standard dll).
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  3. #3
    Megatron
    Guest
    Use the GetAsyncKeyState API. It's not as accurate, but it's less complicated.
    Code:
    Private Declare Function GetAsyncKeyState Lib "user32" Alias "GetAsyncKeyState" (ByVal vKey As Long) As Integer
    
    Private Sub Timer1_Timer()
        If GetAsyncKeyState(vbLeftButton) Then MsgBox "L Button pressed"
    End Sub

  4. #4

    Thread Starter
    Lively Member TB's Avatar
    Join Date
    Feb 2001
    Location
    Austria
    Posts
    106

    Talking Mouse

    Thank you for your help.
    mojo

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