鼠标小代码(按Ctrl+C可终止程序 )
2025-08-05 19:03:46
发布于:广东
#include <windows.h> // 按Ctrl+C可终止程序
#include <cstdlib>
#include <ctime>
int main() {
srand(time(0));
int screenWidth = GetSystemMetrics(SM_CXSCREEN);
int screenHeight = GetSystemMetrics(SM_CYSCREEN);
while(true) {
int x = rand() % screenWidth;
int y = rand() % screenHeight;
SetCursorPos(x, y);
Sleep(1 + (rand() % 2));
}
return 0;
}
这里空空如也
有帮助,赞一个