Results 1 to 2 of 2

Thread: Detect Mouse

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2000
    Posts
    71

    Question Detect Mouse

    Is it possible to detect if the mouse is disabled?

  2. #2
    jim mcnamara
    Guest
    Try

    Code:
    Declare Function GetSystemMetrics Lib "user32.dll" (ByVal nIndex As Long) As Long 
    
    Const SM_MOUSEPRESENT = 19
    Const SM_CMOUSEBUTTONS = 43
    
    Sub MouseCheck()
         Dim NumButtons as Long
         Dim IsMouse as Boolean
         IsMouse = ( GetSystemMetrics(SM_MOUSEPRESENT) > 0)
         If IsMouse then
             NumButtons = GetSystemMetrics(SM_CMOUSEBUTTONS)
             If NumButtons > 0 then 
                   Print "Mouse buttons = ";NumButtons
             Else
                   Print "Mouse disabled"
             End If
         Else
             Print "No Mouse installed"
         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