Tuesday, 15 April 2014

delphi - how to simulate rotating down the scroll button using mouse_event(MOUSEEVENTF_WHEEL -



delphi - how to simulate rotating down the scroll button using mouse_event(MOUSEEVENTF_WHEEL -

whatever positive value in place of 100(dwdata), scrolling takes place instead of scrolling down. negative value shows error. d7 help (i'm on xe2 though) says negative value , nt. if such function old xp, please suggest alternative solution.

procedure tmainform.tmr1timer(sender: tobject); begin mouse_event(mouseeventf_wheel, 0, 0, 100, 0); end;

the documentation says:

if dwflags contains mouseeventf_wheel, dwdata specifies amount of wheel movement. positive value indicates wheel rotated forward, away user; negative value indicates wheel rotated backward, toward user. 1 wheel click defined wheel_delta, 120.

note documentation linked msdn website. source windows api.

so utilize wheel_delta 1 forwards click, -wheel_delta 1 backward click. you'll need cast negative value:

mouse_event(mouseeventf_wheel, 0, 0, dword(-wheel_delta), 0);

you don't need utilize multiples of wheel delta. perhaps dword(-100) fine.

one final point sendinput preferred mouse_event. not issue because inject 1 input event, using sendinput habit acquire.

delphi delphi-xe2

No comments:

Post a Comment