#include <iostream>
#include <stdio.h>
#include <windows.h>
#include <stdlib.h>
using namespace std;
int main()
{
cout << "进入程序\n";
Sleep(100);
cout << "开发者:GROZA(QQ:1140457732)\n";
Sleep(100);
cout << "请注意:在程序运行中,如果您想要关闭程序,请按下 Q键;本程序连续按下的是 回车键。\n";
Sleep(2000);
int a , b;
while (true)
{
if (-32767 == GetAsyncKeyState('Q'))
{
system("taskkill -f -im 连点器.exe -t");
}
else
{
cout << "请输入您需要连点的次数(输入0退出程序):";
cin >> a;
if (a == 0) {
system("taskkill -f -im 连点器.exe -t");
}
else {
cout << "请问您想让程序按下 鼠标左键 还是 回车键?(输入数字1或2:1:左键;2:回车键;其他键退出):";
cin >> b;
if (b == 2) {
cout << "正在启动程序,请等待三秒" << endl;
Sleep(1000);
cout << "3" << endl;
Sleep(1000);
cout << "2" << endl;
Sleep(1000);
cout << "1" << endl;
for (int i = 1; i <= a; i++) {
keybd_event(VK_RETURN, 0, 0, 0);
keybd_event(VK_RETURN, 0, KEYEVENTF_KEYUP, 0);
Sleep(10);
if (-32767 == GetAsyncKeyState('Q'))
{
system("taskkill -f -im 连点器.exe -t");
i = a;
}
}
}
else if (b == 1) {
cout << "正在启动程序,请等待三秒" << endl;
Sleep(1000);
cout << "3" << endl;
Sleep(1000);
cout << "2" << endl;
Sleep(1000);
cout << "1" << endl;
for (int i = 1; i <= a; i++) {
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
Sleep(10);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
Sleep(10);
if (-32767 == GetAsyncKeyState('Q'))
{
system("taskkill -f -im 连点器.exe -t");
i = a;
}
}
}
else {
system("taskkill -f -im 连点器.exe -t");
}
}
}
}
}
————————————————
版权声明:本文为CSDN博主「@GROZA」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_46612155/article/details/115426422