VB Code:
  1. Private Declare Function GetSystemMetrics Lib "user32.dll" (ByVal nIndex As Long) As Long
  2.  
  3. Private Sub Form_Load()
  4.  
  5.     Dim x As Long
  6.  
  7.     x = GetSystemMetrics(19)
  8.  
  9.     If x Then
  10.  
  11.         MsgBox "Mouse is installed"
  12.  
  13.     Else
  14.  
  15.         MsgBox "Mouse is not installed"
  16.  
  17.     End If
  18.  
  19. End Sub