public void SetCoursorPosition(Vector3 mousePos) { GameCursor.POINT lpPoint = new GameCursor.POINT(0, 0); GameCursor.ClientToScreen(this.windowPtr, ref lpPoint); GameCursor.GetWindowRect(this.windowPtr, ref this.winRect); GameCursor.POINT point = new GameCursor.POINT(lpPoint.X - this.winRect.left, lpPoint.Y - this.winRect.top); lpPoint.X = (int)mousePos.x; lpPoint.Y = Screen.get_height() - (int)mousePos.y; GameCursor.ClientToScreen(this.windowPtr, ref lpPoint); GameCursor.SetCursorPos(lpPoint.X + point.X, lpPoint.Y + point.Y); }
private static extern bool GetCursorPos(out GameCursor.POINT lpPoint);
private static extern bool ClientToScreen(IntPtr hWnd, ref GameCursor.POINT lpPoint);