Tao.Platform.Windows SDK Documentation

Winmm.joyGetPosEx Method 

The joyGetPosEx function queries a joystick for its position and button status.

[Visual Basic]
Public Shared Function joyGetPosEx( _
   ByVal uJoyID As Integer, _
   ByRef pji As JOYINFOEX _
) As Integer
[C#]
public static int joyGetPosEx(
   int uJoyID,
   ref JOYINFOEX pji
);

Parameters

uJoyID
Identifier of the joystick to be queried. Valid values for uJoyID range from zero (JOYSTICKID1) to 15, except for Windows NT 4.0. For Windows NT 4.0, valid values are limited to JOYSTICKID1 and JOYSTICKID2.
pji
Pointer to a Winmm.JOYINFOEX structure that contains extended position information and button status of the joystick. You must set the dwSize and dwFlags members or joyGetPosEx will fail. The information returned from joyGetPosEx depends on the flags you specify in dwFlags.

Return Value

Returns JOYERR_NOERROR if successful or one of the following error values.

Returns 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. Windows 95/98/Me: The specified joystick identifier is invalid. MMSYSERR_BADDEVICEID - Windows 95/98/Me: The specified joystick identifier is invalid. JOYERR_UNPLUGGED - The specified joystick is not connected to the system. JOYERR_PARMS - Windows NT/2000/XP: The specified joystick identifier is invalid.

Remarks

This function provides access to extended devices such as rudder pedals, point-of-view hats, devices with a large number of buttons, and coordinate systems using up to six axes. For joystick devices that use three axes or fewer and have fewer than four buttons, use the joyGetPos function.

See Also

Winmm Class | Tao.Platform.Windows Namespace