Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #include <stdio.h>
  2. #include <Windows.h>
  3.  
  4. void spostaMouse(int x, int y);
  5.  
  6. int _tmain(int argc, _TCHAR* argv[])
  7. {
  8.     int i;
  9.  
  10.     for (i = 0; i < GetSystemMetrics(SM_CXSCREEN); i++)
  11.     {
  12.         spostaMouse(i, 200);
  13.         Sleep(10);
  14.     }
  15.  
  16.     return 0;
  17. }
  18.  
  19. void spostaMouse(int x, int y)
  20. {
  21.     INPUT input;
  22.  
  23.     memset(&input, 0, sizeof(INPUT));
  24.  
  25.     input.type = INPUT_MOUSE;
  26.     input.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE;
  27.  
  28.     input.mi.mouseData = 0;
  29.  
  30.     input.mi.dx = x * (65536 / GetSystemMetrics(SM_CXSCREEN));
  31.     input.mi.dy = y * (65536 / GetSystemMetrics(SM_CYSCREEN));
  32.  
  33.     SendInput(1, &input, sizeof(INPUT));
  34.  
  35.     return;
  36. }