搜索
查看: 766|回复: 17
打印 上一主题 下一主题

怎么获取鼠标坐标?

[复制链接]
楼主
发表于 2018-1-21 14:13:57 | 显示全部楼层
小意思啦![mw_shl_code=c,true]#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int main()
{
        POINT poi;
    while(TRUE)
        {
                GetCursorPos(&poi);
        printf("x=%d y=%d",poi.x,poi.y);
                Sleep(1000);
        system("cls");
    }
        return 0;
}
[/mw_shl_code]

1.png (22.55 KB, 下载次数: 12)

1.png
沙发
发表于 2018-1-21 14:26:08 | 显示全部楼层
GetCursorPos(POINT)

点评

Windows API,需 windows.h 头文件!  发表于 2018-1-21 14:27
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

广播台
特别关注
快速回复 返回顶部 返回列表