private bool RegisterForRawInput(RawInput.RAWINPUTDEVICE[] devices) { Debug.WriteLine("RegisterForRawInput(): Registering {0} device(s).", devices.Length); if ( !RawInput.RegisterRawInputDevices(devices, (uint)devices.Length, (uint)Marshal.SizeOf(typeof(RawInput.RAWINPUTDEVICE)))) { int dwError = Marshal.GetLastWin32Error(); Debug.WriteLine("RegisterForRawInput(): error={0}", dwError); throw new Win32Exception(dwError, "PhilipsMceUsbIrReceiverSpinelPlus:RegisterForRawInput()"); } Debug.WriteLine("RegisterForRawInput(): Done."); return(true); }
private bool RegisterForRawInput(RawInput.RAWINPUTDEVICE[] devices) { return(RawInput.RegisterRawInputDevices(devices, (uint)devices.Length, (uint)Marshal.SizeOf(devices[0]))); }