private void timer1_Tick(object sender, EventArgs e) { Win32.POINT p = new Win32.POINT(); Win32.GetCursorPos(ref p); if (flipped) { p.x = p.x + 5; p.y = p.y + 5; } else { p.x = p.x - 5; p.y = p.y - 5; } flipped = !flipped; Win32.LeftClick(); //counter += 1; //if (counter == maxcount) counter = 1; //const string alttab = "%{Tab}"; //string keys = ""; //for (int j = 0; j < counter; ++j) keys += alttab; //SendKeys.SendWait(keys); Win32.SetCursorPos(p.x, p.y); }
public static extern bool ClientToScreen(IntPtr hWnd, ref Win32.POINT point);
public static extern bool GetCursorPos(ref Win32.POINT lpPoint);