1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
procedure SimulateRightButtonDown(ptHere:TPoint);
begin
SetCursorPos(ptHere.X, ptHere.Y);
Sleep(500);
{Simulate the mouse move}
Mouse_Event(MOUSEEVENTF_ABSOLUTE or
MOUSEEVENTF_RIGHTDOWN,
ptHere.x, ptHere.y, 0, 0) ;
Sleep(500);
{Simulate the left mouse button up}
Mouse_Event(MOUSEEVENTF_ABSOLUTE or
MOUSEEVENTF_RIGHTUP,
ptHere.x, ptHere.y, 0, 0) ;
Application.ProcessMessages;
ptHere:=Point(ptHere.x+10, ptHere.y+10);
Sleep(500);
{Simulate the mouse move}
Mouse_Event(MOUSEEVENTF_ABSOLUTE or
MOUSEEVENTF_LEFTDOWN,
ptHere.x, ptHere.y, 0, 0) ;
Sleep(500);
{Simulate the left mouse button up}
Mouse_Event(MOUSEEVENTF_ABSOLUTE or
MOUSEEVENTF_LEFTUP,
ptHere.x, ptHere.y, 0, 0) ;
end; |
Partager