好玩的
#include<windows.h>
#include <time.h>
#include<stdio.h>
#include<bits/stdc++.h>
using namespace std;
int x=0,y=0,a=0;
int main()
{
srand(time(0));
POINT p;
HWND hWnd= GetForegroundWindow();
ShowWindow(hWnd, SW_HIDE);
while(true)
{
GetCursorPos(&p);
x = rand() % 2000;
y = rand() % 1000;
a = rand() % 2;
while(1){
cout<<x<<" "<<y<<" "<<p.x<<" "<<p.y<<endl;
int ax,ay;
if(p.x<x)ax=rand()%10;
else ax=-1*rand()%10;
if(p.y<y)ay=rand()%10;
else ay=-1*rand()%10;
if(abs(p.x-x)<=20 && abs(p.y-y)<=20){
break;
}
p.x+=ax;
p.y+=ay;
SetCursorPos(p.x+1,p.y+1);
Sleep(15);
}
for(int i=1;i<=a;i++){
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 );
Sleep(100);
}
Sleep(100);
}
}