by S.Raghu (1 Submission)
Category: Windows System Services
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Mon 26th June 2000
Date Added: Mon 8th February 2021
Rating:
(1 Votes)
Code to Detect the Mouse and number of buttons present on the mouse
API Declarations
Private Const SM_CMOUSEBUTTONS = 43
Private Const SM_MOUSEPRESENT = 19
Dim X As Long, Y As Long
Dim S As String
Private Sub Command1_Click()
X = GetSystemMetrics(SM_MOUSEPRESENT)
If X = 1 Then
Y = GetSystemMetrics(SM_CMOUSEBUTTONS)
S = "MOUSE IS PRESENT AND " & vbCrLf
S = S & "IT HAS " & CStr(Y) & " BUTTONS ON IT"
MsgBox S, vbExclamation, "Mouse"
Else
MsgBox "Attention! Mouse is not present", vbCritical, "Mouse"
End If
End Sub
No comments have been posted about Code to Detect the Mouse and number of buttons present on the mouse. Why not be the first to post a comment about Code to Detect the Mouse and number of buttons present on the mouse.