Пример #1
0
        public static uint SendInput(Input[] inputs)
        {
            var len      = (uint)inputs.Length;
            var size     = Marshal.SizeOf <Input>();
            var gcHandle = GCHandle.Alloc(inputs, GCHandleType.Pinned);

            try { return(User32Methods.SendInput(len, gcHandle.AddrOfPinnedObject(), size)); }
            finally { gcHandle.Free(); }
        }
Пример #2
0
 public static unsafe uint SendInput(ref Input input)
 {
     fixed(Input *ptr = &input) return(User32Methods.SendInput(1, new IntPtr(ptr), Marshal.SizeOf <Input>()));
 }