Declare Function joyGetDevCaps Lib "winmm.dll" Alias "joyGetDevCapsA" (ByVal id As Long, ByVal lpCaps As JOYCAPS, ByVal uSize As Long) As Long
joyGetDevCaps reads various information about a joystick. This information is put into the variable passed as lpCaps. This function does not, however, give you the current position of the joystick. The function returns 0 if the joystick is connected and working and a non-zero value if it isn't.
Example:
' Check if joystick #1 is connected (ID = 0)
Dim cap As JOYCAPS
x = joyGetDevCaps(0, cap, Len(cap))
If x = 0 Then Debug.Print "Joystick #1 is in full working order."
Category: Joysticks
Back to the index.