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 );
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, Marshal.SizeOf(jOYCAPS)) != 0) { throw new NotConnectedException("The requested joystick is not connected to the system."); } info = new DeviceInfo(id, jOYCAPS); }