@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: Registers a device to send its raw input data. !!!!C# Signature: /// <summary>Function to register a raw input device.</summary> /// <param name="pRawInputDevices">Array of raw input devices.</param> /// <param name="uiNumDevices">Number of devices.</param> /// <param name="cbSize">Size of the RAWINPUTDEVICE structure.</param> /// <returns>TRUE if successful, FALSE if not.</returns> [DllImport("user32.dll")] public static extern bool RegisterRawInputDevices([MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] RAWINPUTDEVICE[] pRawInputDevices, int uiNumDevices, int cbSize); !!!!VB.NET Signature: ''' <summary>Function to register a raw input device.</summary> ''' <param name="pRawInputDevices">Array of raw input devices.</param> ''' <param name="uiNumDevices">Number of devices.</param> ''' <param name="cbSize">Size of the RAWINPUTDEVICE structure.</param> ''' <returns>True if successful, False if not.</returns> <DllImport("user32.dll")> _ Public Shared Function RegisterRawInputDevices(<MarshalAs(UnmanagedType.LPArray, SizeParamIndex := 0)> ByVal pRawInputDevices As RAWINPUTDEVICE(), ByVal uiNumDevices As Integer, ByVal cbSize As Integer) As Boolean End Function !!!!User-Defined Types: [RAWINPUTDEVICE] !!!!Alternative Managed API: Do you know one? Please contribute it! !!!!Notes: According to the Microsoft documentation last two parameters are unsigned integers not integers. !!!!Tips & Tricks: Please add some! !!!!Sample Code: private void RegisterMouse() { RAWINPUTDEVICE device; device.WindowHandle = this.Handle; device.UsagePage = 0x01; device.Usage = 0x02; device.Flags = RawInputDeviceFlags.InputSink; Win32API.RegisterRawInputDevices(device); } /// <summary> /// Function to register a raw input device. /// </summary> /// <param name="device">Device information.</param> /// <returns>TRUE if successful, FALSE if not.</returns> public static bool RegisterRawInputDevices(RAWINPUTDEVICE device) { RAWINPUTDEVICE[] devices = new RAWINPUTDEVICE[1]; // Raw input devices. devices[0] = device; return RegisterRawInputDevices(devices, 1, Marshal.SizeOf(typeof(RAWINPUTDEVICE))); } Documentation: RegisterRawInputDevices@msdn on MSDN
Edit user32.RegisterRa...
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.