用c++打造专属鼠标连点器

#include<bits/stdc++.h>//鼠标连点器
#include<windows.h>
using namespace std;
signed main(){
int n;
cout<<“鼠标连点器使用说明:\n”;
cout<<“1.按F2键开始,按F2键暂停,退出请按Esc。\n”;
cout<<“2.输入毫秒时,一定输入大于50的数,否则电脑会爆!\n”;
system(“pause”);
cout<<“你想每多少毫秒点击鼠标(1秒=1000毫秒)?\n”;
cin>>n;
system(“cls”);
while(1){
if(GetAsyncKeyState(VK_F2)){
while(1){
mouse_event(MOUSEEVENTF_LEFTDOWN|MOUSEEVENTF_LEFTUP,0,0,0,0);
Sleep(n);
if(GetAsyncKeyState(VK_F2)) break;
if(GetAsyncKeyState(VK_ESCAPE)) return 0;
}
}
if(GetAsyncKeyState(VK_ESCAPE)) return 0;
}
return 0;
}

文章分类 问答 标签:
在线时间9:00~22:00