临时代码

#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <conio.h>
#include <windows.h>
using namespace std;

int main () {
	srand (time (0));
	while (1) {
		if (GetAsyncKeyState ('Q')) {
			while (1) {
				int x = rand () % 1600;
				int y = rand () % 900;
				POINT p;
				GetCursorPos (&p);
				SetCursorPos (p.x = x, p.y = y);
				mouse_event (MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
				Sleep (1);
				mouse_event (MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
				if (GetAsyncKeyState (VK_SPACE)) break;
			}
		}
	}
	return 0;
} 
原文地址:https://www.cnblogs.com/cqbzyanglin/p/13825077.html