Esempio n. 1
0
        public override bool Transmit(IntPtr windowHandle)
        {
            var inputAr = ToArray();

            if (inputAr.Length == 0)
            {
                return(false);
            }

            try
            {
                return(WindowsAPI.SendInputTo(windowHandle, (uint)inputAr.Length, inputAr,
                                              System.Runtime.InteropServices.Marshal.SizeOf(typeof(WindowsAPI.Input))));
            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.Message);
                return(false);
            }
        }