Example #1
0
        /// <summary>
        /// Move the mouse to Point p
        /// </summary>
        /// <param name="p">The point to move the mouse to</param>
        public void moveMouse(Point p)
        {
            Cursor cur = Cursors.Default;

            screen = DrawAbleScreenFetcher.fetchOpaque(getPid());
            if (screen == null)
            {
                Console.WriteLine("Screen is null");
                return;
            }


            if (appWin == IntPtr.Zero)
            {
                Console.WriteLine("Mouse appWin is null1: " + getPid());
                return;
            }


            this.X = p.X;
            this.Y = p.Y;



            //PostMessage(appWin, (int)WMessages.WM_NCHITTEST, 0, 0x009803CE);
            //SendMessage(appWin, (int)WMessages.WM_SETCURSOR, (long)appWin, ZiadSpace.Util.BitHelper.MakeLong(300, 200));
            //PostMessage(hWndCalc, (int)WMessages.WM_MOUSEMOVE, 0, ZiadSpace.Util.BitHelper.MakeDword(300, 200));

            //PostMessage(hWndCalc, (int)WMessages.WM_LBUTTONDOWN, 0, ZiadSpace.Util.BitHelper.MakeDword(300, 200));
            //PostMessage(hWndCalc, (int)WMessages.WM_LBUTTONUP, 0, ZiadSpace.Util.BitHelper.MakeDword(300,200));

            //screen.Invalidate();


            //screen.Invalidate();

            //dllMoveMouse(appWin, X, Y);
            //dllMuseClick(appWin, X, Y);
            screen.drawMouse(new Point(p.X, p.Y), cur);
            //screen.drawLine(Pens.BurlyWood, p, new Point(p.X + 5, p.Y));
            dllMoveMouse(appWin, p.X, p.Y);
        }