如何获取鼠标点击时相对 控制台时的坐标
全部就这些悬赏了
大神看看吧
#include <windows.h> //所需头文件
#include <iostream>
POINT p;
int main() {
//----------循环检测----------
while(1) {
GetCursorPos(&p); //获取鼠标在屏幕上的位置
printf("(%d,%d)\n",p.x,p.y);
Sleep(20); //等待20毫秒,减少CPU占用
}
return 0;
}
GetCursorPos