void CHitTestDlg::OnTimer(UINT_PTR nIDEvent) { // TODO: 在此添加消息处理程序代码和/或调用默认值 CString str; POINT point = { 0 }; BOOL b=::GetCursorPos(&point); //获取鼠标屏幕坐标 /* 参数:LPPOINT lpPoint 返回光标位置 返回值:如果成功,返回非0;如果失败,返回0 */ str.Format(_T("x坐标=%d y坐标=%d\r\n"),point.x,point.y); OutputDebugString(str); CDialogEx::OnTimer(nIDEvent); }
标签:GetCursorPos,MFC,鼠标,point,坐标,str,屏幕 From: https://www.cnblogs.com/liming19680104/p/17370301.html