wMaxAxes As Long ' Maximum number of axes supported by the joystick.
wNumAxes As Long ' Number of axes currently in use by the joystick.
wMaxButtons As Long ' Maximum number of buttons supported by the joystick.
szRegKey As String * MAXPNAMELEN ' String containing the registry key for the joystick.
End Type
Declare Function joyGetPosEx Lib "winmm.dll" (ByVal uJoyID As Long, pji As JOYINFOEX) As Long
' This function queries a joystick for its position and button status. The function
' requires the following parameters;
' uJoyID- integer identifying the joystick to be queried. Use the constants
' JOYSTICKID1 or JOYSTICKID2 for this value.
' pji- user-defined type variable that stores extended position information
' and button status of the joystick. The information returned from
' this function depends on the flags you specify in dwFlags member of
' the user-defined type variable.
'
' The function returns the constant JOYERR_NOERROR if successful or one of the
' following error values:
' MMSYSERR_NODRIVER- The joystick driver is not present.
' MMSYSERR_INVALPARAM- An invalid parameter was passed.
' MMSYSERR_BADDEVICEID- The specified joystick identifier is invalid.
' JOYERR_UNPLUGGED- The specified joystick is not connected to the system.
Declare Function joyGetDevCaps Lib "winmm.dll" Alias "joyGetDevCapsA" (ByVal id As Long, lpCaps As JOYCAPS, ByVal uSize As Long) As Long
' This function queries a joystick to determine its capabilities. The function requires
' the following parameters:
' uJoyID- integer identifying the joystick to be queried. Use the contstants
' JOYSTICKID1 or JOYSTICKID2 for this value.
' pjc- user-defined type variable that stores the capabilities of the joystick.
' cbjc- Size, in bytes, of the pjc variable. Use the Len function for this value.
' The function returns the constant JOYERR_NOERROR if a joystick is present or one of
' the following error values:
' MMSYSERR_NODRIVER- The joystick driver is not present.
' MMSYSERR_INVALPARAM- An invalid parameter was passed.
Public Const JOYSTICKID1 = 0
Public Const JOYSTICKID2 = 1
Public Const JOY_RETURNBUTTONS = &H80&
Public Const JOY_RETURNCENTERED = &H400&
Public Const JOY_RETURNPOV = &H40&
Public Const JOY_RETURNR = &H8&
Public Const JOY_RETURNU = &H10
Public Const JOY_RETURNV = &H20
Public Const JOY_RETURNX = &H1&
Public Const JOY_RETURNY = &H2&
Public Const JOY_RETURNZ = &H4&
Public Const JOY_RETURNALL = (JOY_RETURNX Or JOY_RETURNY Or JOY_RETURNZ Or JOY_RETURNR Or JOY_RETURNU Or JOY_RETURNV Or JOY_RETURNPOV Or JOY_RETURNBUTTONS)