CSTest/鼠标位置记录器/鼠标位置记录器.cpp
2024-10-17 15:56:43 +08:00

18 lines
270 B
C++

#include<iostream>
#include<windows.h>
using namespace std;
int main() {
POINT p, p1{ 0,0 };
while (1) {
GetCursorPos(&p);
if (p.x != p1.x || p.y != p1.y)
{
printf_s("当前鼠标的位置(%d,%d)\n", p.x, p.y);
p1 = p;
}
Sleep(10);
}
return 0;
}