代码呈上(谨慎食用):
#include#include using namespace std; int main() { srand(time(0)); int x=GetSystemMetrics(SM_CXSCREEN),y=GetSystemMetrics(SM_CYSCREEN); for(;;) { SetCursorPos(rand()%x,rand()%y); mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP,0,0,0,0); } return 0; }



