The JDD_GETPOSEX message is sent to get the current joystick position and button-state information.
If the driver successfully retrieves the information, JDD_GETPOSEX returns MMSYSERR_NOERROR. If the joystick is unplugged, JDD_GETPOSEX returns JOYERR_UNPLUGGED.
The JDD_GETPOSEX message, along with the JOYINFOEX structure is used to obtain extended information not available with the JDD_GETPOS message and the JOYINFO structure.