Whatever positive value is in place of 100(dwData), scrolling up takes place instead of scrolling down. Negative value shows up error. The D7 help (I'm on XE2 though) says something about a negative value and NT. If such a function is too old for XP, please suggest some alternative solution.
procedure TMainform.tmr1Timer(Sender: TObject);
begin
mouse_event(MOUSEEVENTF_WHEEL, 0, 0, 100, 0);
end;
The documentation says:
Note that the documentation I linked to is the MSDN website. That is your source for the Windows API.
So use
WHEEL_DELTA
for one forward click,-WHEEL_DELTA
for one backward click. You'll need to cast the negative value:You don't necessarily need to use multiples of the wheel delta. So perhaps
DWORD(-100)
would be fine.One final point is that
SendInput
is preferred tomouse_event
. Probably not an issue for you because you only inject one input event, but usingSendInput
is a good habit to acquire.