跳到正文

个人记录

不要运行

WTH13564134670约 1 分钟
原文
文章信息与版本

文章信息

发布
2026年10月1日
收录
2026年10月1日
更新
2026年11月14日
篇幅
约 1 分钟

版本

  1. v1当前
C++
#include <windows.h>
#include <cstdlib>
#include <ctime>
#pragma comment(lib, "User32.lib")
int main() {
    srand((unsigned)time(NULL));

    while (true) {
        if (GetAsyncKeyState(VK_ESCAPE) & 0x8000) {
            break;
        }
        POINT p;
        GetCursorPos(&p);
        int dx = (rand() % 401) - 200;  // -200 ~ 200
        int dy = (rand() % 401) - 200;  // -200 ~ 200
        SetCursorPos(p.x + dx, p.y + dy);
        Sleep(20);
    }
    return 0;
}
原文