不要运行

· · 个人记录

#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;
}