#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
int main() {
SetConsoleTitle(TEXT("DefeatLockWindows By Zayki"));
HANDLE hStdin = GetStdHandle(STD_INPUT_HANDLE);
DWORD mode;
GetConsoleMode(hStdin, &mode);
mode &= ~ENABLE_QUICK_EDIT_MODE; //移除快速编辑模式
mode &= ~ENABLE_INSERT_MODE; //移除插入模式
mode &= ~ENABLE_MOUSE_INPUT;
SetConsoleMode(hStdin, mode);
LPCWSTR msg = TEXT("每隔5秒点击一次鼠标左键.等待5秒后开始执行.");
if (MessageBoxW(NULL, msg, TEXT("提示"), MB_OKCANCEL) == 1) {
int a;
for (a = 1; a < 6; a++) {
cout << ".";
Sleep(1000);
}
cout << endl;
int count = 0;
while (1)
{
POINT lp;
if (count % 2 == 0) {
GetCursorPos(&lp);
SetCursorPos(lp.x + 100, lp.y + 100);
}
else
{
GetCursorPos(&lp);
SetCursorPos(lp.x - 100, lp.y - 100);
}
cout << "The current position is:" << lp.x << "," << lp.y << endl;
// 移动到绝对位置单击左键
mouse_event(MOUSEEVENTF_MOVE | MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
count += 1;
cout << "Complete one left click action,the total count is:" << to_string(count) << endl;
cout << "------------------------------------------------------" << endl;
Sleep(5000);
}
return 0;
}
else
{
exit(0);
}
}
最后修改时间:2022-09-11 17:28:03
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




