The joyGetPos function queries a joystick for its position and button status.
MMRESULT joyGetPos(
UINT uJoyID,
LPJOYINFO pji
);
Returns JOYERR_NOERROR if successful or one of the following error values:
| Value | Description | |
|---|---|---|
| MMSYSERR_NODRIVER | The joystick driver is not present. | |
| MMSYSERR_INVALPARAM | An invalid parameter was passed. | |
| JOYERR_UNPLUGGED | The specified joystick is not connected to the system. | |
For devices that have four to six axes of movement, a point-of-view control, or more than four buttons, use the joyGetPosEx function.
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in mmsystem.h.
Import Library: Use winmm.lib.
Joysticks Overview, Multimedia Joystick Functions, JOYINFO, joyGetPosEx