internal RawInputDevice(TopLevelCollectionUsage tlc, RawInputDeviceRegistrationOptions options, IntPtr targetWindowHandle)
 {
     this.tlc                = tlc;
     this.options            = options;
     this.targetWindowHandle = targetWindowHandle;
 }
		/// <summary>Causes the target window to receive raw input messages.
		/// <para>Important: that window must then override its WndProc method to call <see cref="WndProc"/> prior to its base method.</para>
		/// </summary>
		/// <param name="targetWindow">The target window.</param>
		/// <param name="options">One or more <see cref="RawInputDeviceRegistrationOptions"/>.</param>
		/// <param name="usages">At least one TLC usage.</param>
		/// <exception cref="ArgumentNullException"/>
		/// <exception cref="ArgumentException"/>
		public static void Register( IWin32Window targetWindow, RawInputDeviceRegistrationOptions options, params TopLevelCollectionUsage[] usages )
		{
			if( usages == null )
				throw new ArgumentNullException( "usages" );

			if( usages.Length == 0 )
				throw new ArgumentException( "No TLC specified.", "usages" );


			var windowHandle = ( targetWindow == null ) ? IntPtr.Zero : targetWindow.Handle;

			var devices = new RawInputDevice[ usages.Length ];
			for( var d = 0; d < usages.Length; d++ )
				devices[ d ] = new RawInputDevice( usages[ d ], options, windowHandle );

			NativeMethods.RegisterRawInputDevices( devices );
		}