Пример #1
0
        private static void SendMouseInput(int x, int y, NativeEnums.MouseEventFlags flag)
        {
            NativeStructs.INPUT mouseInput = new NativeStructs.INPUT();
            mouseInput.type = NativeEnums.SendInputEventType.InputMouse;
            mouseInput.mkhi.mi.dx = NativeUtilities.CalculateAbsoluteCoordinateX(x);
            mouseInput.mkhi.mi.dy = NativeUtilities.CalculateAbsoluteCoordinateY(y);
            mouseInput.mkhi.mi.mouseData = 0;

            mouseInput.mkhi.mi.dwFlags = flag | NativeEnums.MouseEventFlags.Absolute;
            NativeMethods.SendInput(1, ref mouseInput, Marshal.SizeOf(new NativeStructs.INPUT()));
        }
Пример #2
0
 public static extern uint SendInput(uint nInputs, ref NativeStructs.INPUT pInputs, int cbSize);