You can query a joystick for position and button information by using the joyGetPos function. For example, an application can query the joystick for baseline position values. The Joystick Control Panel property sheet uses this technique when calibrating the joystick.
You can also query a joystick or other device that has extended capabilities by using the joyGetPosEx function.