public static void moveWindow(RECT rect)
        {
            incrementRect = rect;
            Debug.Print("incrementRect {0}, {1}, {2}, {3}", incrementRect.Left, incrementRect.Top,
                incrementRect.Right, incrementRect.Bottom);

            var currentWindow = GetForegroundWindow();

            rct = new RECT
            {
                Right = 0,
                Left = 0,
                Bottom = 0,
                Top = 0
            };

            GetWindowRect(currentWindow, ref rct);
            Debug.Print("rct {0}, {1}, {2}, {3}", rct.Left, rct.Top, rct.Right, rct.Bottom);

            var newRect = new Rect
            {
                X = rct.Left + incrementRect.Left < 0 ? 0 : rct.Left + incrementRect.Left,
                Y = rct.Top + incrementRect.Top < 0 ? 0 : rct.Top + incrementRect.Top
            };

            newRect.Width = updateEdge("Right", newRect.X, CoordinateConverter.SCREEN_WIDTH);
            //Task bar has the height of 50 pixels
            newRect.Height = updateEdge("Bottom", newRect.Y, CoordinateConverter.SCREEN_HEIGHT - 50);

            MoveWindow(currentWindow, (int) newRect.X, (int) newRect.Y,
                (int) newRect.Width, (int) newRect.Height, true);
        }
        public void setIncrementRect()
        {
            var incrementRect = new RECT();
            int rightMove = (int)((scaleRightBase.Position.Y - tracker.curHandRightPoint.Position.Y) * SCALE_SENSITIVITY);
            int leftMove = (int)((scaleLeftBase.Position.Y - tracker.curHandLeftPoint.Position.Y) * SCALE_SENSITIVITY);

            incrementRect.Bottom = scaleRightBase.Position.Y + 0.2 < scaleLeftBase.Position.Y ? rightMove : leftMove;
            incrementRect.Top = scaleRightBase.Position.Y + 0.2 < scaleLeftBase.Position.Y ? leftMove : rightMove;

            incrementRect.Right = (int)((tracker.curHandRightPoint.Position.X - scaleRightBase.Position.X) * SCALE_SENSITIVITY);
            incrementRect.Left = (int)((tracker.curHandLeftPoint.Position.X - scaleLeftBase.Position.X) * SCALE_SENSITIVITY);

            tracker.IncrementRect = incrementRect;
        }
 internal static extern bool GetWindowRect(IntPtr hwnd, ref RECT lpRect);