#include <stdio.h>
#include <Windows.h>
void spostaMouse(int x, int y);
int _tmain(int argc, _TCHAR* argv[])
{
int i;
for (i = 0; i < GetSystemMetrics(SM_CXSCREEN); i++)
{
spostaMouse(i, 200);
Sleep(10);
}
return 0;
}
void spostaMouse(int x, int y)
{
INPUT input;
memset(&input, 0, sizeof(INPUT));
input.type = INPUT_MOUSE;
input.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE;
input.mi.mouseData = 0;
input.mi.dx = x * (65536 / GetSystemMetrics(SM_CXSCREEN));
input.mi.dy = y * (65536 / GetSystemMetrics(SM_CYSCREEN));
SendInput(1, &input, sizeof(INPUT));
return;
}