WORD joyGetPos(wId, lpInfo)
This function queries for the position and button activity of a joystick device.
WORD wId
Identifies the joystick device to be queried. This value is either JOYSTICKID1 or JOYSTICKID2.
LPJOYINFO lpInfo
Specifies a far pointer to a JOYINFO data structure. This structure is filled with information about the position and button activity of the joystick device.
Returns JOYERR_NOERROR if successful. Otherwise, returns one of the following error codes:
MMSYSERR_NODRIVER
The joystick driver is not present.
JOYERR_PARMS
The specified joystick device ID wId is invalid.
JOYERR_UNPLUGGED
The specified joystick is not connected to the system.