Accord.Controls.JoystickAPI.joyGetDevCapsW C# (CSharp) Method

joyGetDevCapsW() private method

private joyGetDevCapsW ( int uJoyID, [ pjc, int cbjc ) : ResultCode
uJoyID int
pjc [
cbjc int
return ResultCode
        public static extern ResultCode joyGetDevCapsW(int uJoyID,
            [In, Out, MarshalAs(UnmanagedType.LPStruct)] JOYCAPS pjc,
            int cbjc);

Usage Example

Beispiel #1
0
        /// <summary>
        /// Initialize joystick with the specified ID.
        /// </summary>
        ///
        /// <param name="id">Joystick's ID to initialize, [0, 15].</param>
        ///
        /// <remarks><para></para></remarks>
        ///
        /// <exception cref="ArgumentException">Invalid joystick ID was specified. It must be in [0, 15] range.</exception>
        /// <exception cref="NotConnectedException">The requested joystick is not connected to the system.</exception>
        ///
        public void Init(int id)
        {
            if ((id < 0) || (id > 15))
            {
                throw new ArgumentException("Invalid joystick ID was specified.");
            }

            JoystickAPI.JOYCAPS joyCaps = new JoystickAPI.JOYCAPS();

            if (JoystickAPI.joyGetDevCapsW(id, joyCaps,
                                           System.Runtime.InteropServices.Marshal.SizeOf(joyCaps)) != JoystickAPI.ResultCode.NoError)
            {
                throw new NotConnectedException("The requested joystick is not connected to the system.");
            }

            info = new DeviceInfo(id, joyCaps);
        }
All Usage Examples Of Accord.Controls.JoystickAPI::joyGetDevCapsW