Exemple #1
0
        public static void MouseClick(IntPtr hWnd, Point pt, TYPE_BUTTON tb, TYPE_CLICK tc)
        {
            int x = pt.X;
            int y = pt.Y;

            if (hWnd != IntPtr.Zero)
            {
                WinApi.RECT rect;
                WinApi.GetWindowRect(hWnd, out rect);
                //x += rect.left;
                //y += rect.top;
            }
            KmMouseMove(x, y, true, true);
            Sleep(100);
            MouseClick(tb, tc);
        }
Exemple #2
0
        public static void MouseClick(TYPE_BUTTON tb, TYPE_CLICK tc)
        {
            bool flagLb = true;

            if (tb == TYPE_BUTTON.R_BUTTON)
            {
                flagLb = false;
            }

            //KmMouseMove(x, y, true, true);
            //Sleep(500);
            switch (tc)
            {
            case TYPE_CLICK.BUTTON_CLICK:

                KmMouseKey(flagLb, true);
                Sleep(100);
                KmMouseKey(flagLb, false);
                Sleep(10);
                break;

            case TYPE_CLICK.BUTTON_DOUBLE_CLICK:
                KmMouseKey(flagLb, true);
                Sleep(10);
                KmMouseKey(flagLb, false);
                Sleep(50);
                KmMouseKey(flagLb, true);
                Sleep(10);
                KmMouseKey(flagLb, false);
                Sleep(10);
                break;

            case TYPE_CLICK.BUTTON_DOWN:
                KmMouseKey(flagLb, true);
                Sleep(10);
                break;

            case TYPE_CLICK.BUTTON_UP:
                KmMouseKey(flagLb, false);
                Sleep(10);
                break;

            default:
                break;
            }
        }
Exemple #3
0
 public static void MouseClick(IntPtr hWnd, int x, int y, TYPE_BUTTON tb, TYPE_CLICK tc)
 {
     MouseClick(hWnd, new Point(x, y), tb, tc);
 }