Since so many people are talking about moving the mouse outside of the screen, I decided to see about scrolling the mouse wherever you want. The below code is not really mine. I found it on Stack Overflow and then edited it.
UINT ScrollMouse(int x, int y, int scroll) //save as scroll.h
{
INPUT input;
POINT pos;
SetCursorPos(x,y);
pos.x = x;
pos.y = y;
input.type = INPUT_MOUSE;
input.mi.dwFlags = MOUSEEVENTF_WHEEL;
input.mi.time = NULL; //Windows will do the timestamp
input.mi.mouseData = (DWORD)scroll*WHEEL_DELTA; //A positive value indicates that the wheel was rotated forward, away from the user; a negative value indicates that the wheel was rotated backward, toward the user. One wheel click is defined as WHEEL_DELTA, which is 120.
input.mi.dx = pos.x;
input.mi.dy = pos.y;
input.mi.dwExtraInfo = GetMessageExtraInfo();
return SendInput(1, &input, sizeof(INPUT));
}
Print ScrollMouse
(2460, 500, -3) 'I have 3 monitors so my width goes beyond regular resolutions.