function MouseToScreen(mVertical: Boolean; mMouse: Integer): Integer;
begin
case mVertical of
False: Result := Round(mMouse * (MAXWORD / Screen.Width));
else
Result := Round(mMouse * (MAXWORD / Screen.Height));
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
vPoint: TPoint;
begin
vPoint.X := 500;
vPoint.Y := 350;
mouse_event(MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_MOVE,MouseToScreen(False, vPoint.X),
MouseToScreen(True, vPoint.Y), 0, 0);
mouse_event(MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_LEFTDOWN,
MouseToScreen(False, vPoint.X), MouseToScreen(True, vPoint.Y), 0, 0);
Dec(vPoint.X, 200);
Dec(vPoint.Y, 200);
mouse_event(MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_MOVE,MouseToScreen(False, vPoint.X),
MouseToScreen(True, vPoint.Y), 0, 0);
mouse_event(MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_LEFTUP,
MouseToScreen(False, vPoint.X), MouseToScreen(True, vPoint.Y), 0, 0);
end;
delphi 实现自动刷抖音
猜你喜欢
转载自blog.csdn.net/Listest/article/details/121281141
今日推荐
周排行