这是一个鼠标连点器(C++)
Code:
#include <cstdio>
#include <conio.h>
#include <ctime>
#include <windows.h>
#include <vector>
#include <string>
using namespace std;
void set_cursor(bool hide) {
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO CursorInfo;
GetConsoleCursorInfo(handle, &CursorInfo);
CursorInfo.bVisible = hide;
SetConsoleCursorInfo(handle, &CursorInfo);
}
void gotoxy(int x, int y) {
COORD c = {(SHORT)x, (SHORT)y};
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), c);
}
void setmode() {
HANDLE hStdin = GetStdHandle(STD_INPUT_HANDLE);
DWORD mode;
GetConsoleMode(hStdin, &mode);
mode &= ~ENABLE_QUICK_EDIT_MODE;
SetConsoleMode(hStdin, mode);
}
struct Click {
int x, y;
int delay;
int button_down, button_up;
std::string msg;
};
int main() {
setmode();
std::printf("欢迎使用鼠标连点器!\n\n");
_ReStart_:
system("mode con cols=40 lines=15");
set_cursor(