Exemple #1
0
        static public Vektor2DInt?ClientToScreen(this IntPtr hWnd, Vektor2DInt locationInClient)
        {
            var structWinApi = locationInClient.AsWindowsPoint();

            if (!BotEngine.WinApi.User32.ClientToScreen(hWnd, ref structWinApi))
            {
                return(null);
            }

            return(structWinApi.AsVektor2DInt());
        }
		static public void MouseMoveToPointInClientRect(
			IntPtr WindowHandle,
			Vektor2DInt DestinationPointInClientRect,
			out POINT DestinationPointInScreen)
		{
			DestinationPointInScreen = DestinationPointInClientRect.AsWindowsPoint();

			// get screen coordinates
			BotEngine.WinApi.User32.ClientToScreen(WindowHandle, ref DestinationPointInScreen);

			var lParam = (IntPtr)((((int)DestinationPointInClientRect.B) << 16) | ((int)DestinationPointInClientRect.A));
			var wParam = IntPtr.Zero;

			BotEngine.WinApi.User32.SetCursorPos(DestinationPointInScreen.x, DestinationPointInScreen.y);

			BotEngine.WinApi.User32.SendMessage(WindowHandle, (uint)SictMessageTyp.WM_MOUSEMOVE, wParam, lParam);
		}
Exemple #3
0
        static public void MouseMoveToPointInClientRect(
            IntPtr WindowHandle,
            Vektor2DInt DestinationPointInClientRect,
            out POINT DestinationPointInScreen)
        {
            DestinationPointInScreen = DestinationPointInClientRect.AsWindowsPoint();

            // get screen coordinates
            BotEngine.WinApi.User32.ClientToScreen(WindowHandle, ref DestinationPointInScreen);

            var lParam = (IntPtr)((((int)DestinationPointInClientRect.B) << 16) | ((int)DestinationPointInClientRect.A));
            var wParam = IntPtr.Zero;

            BotEngine.WinApi.User32.SetCursorPos(DestinationPointInScreen.x, DestinationPointInScreen.y);

            BotEngine.WinApi.User32.SendMessage(WindowHandle, (uint)SictMessageTyp.WM_MOUSEMOVE, wParam, lParam);
        }
Exemple #4
0
		static public Vektor2DInt? ClientToScreen(this IntPtr hWnd, Vektor2DInt locationInClient)
		{
			var structWinApi = locationInClient.AsWindowsPoint();

			if (!BotEngine.WinApi.User32.ClientToScreen(hWnd, ref structWinApi))
				return null;

			return structWinApi.AsVektor2DInt();
		}