qt 鼠标钩子报错

虚竹777777 2018-05-18 01:31:43
我想写一个鼠标钩子,作用是只允许鼠标在顶层窗口有效。上面不知道出了什么问题,debug时报while parsing target library list: not well-formed (invalid token),跪求大佬指点
代码如下
LRESULT CALLBACK mouseProc(int nCode,WPARAM wParam,LPARAM lParam )
{
MOUSEHOOKSTRUCT *pkbhs = (MOUSEHOOKSTRUCT *) lParam;
HWND hwnd = ::GetForegroundWindow();
LPRECT lpRect;
::GetWindowRect(hwnd,lpRect);
int x = pkbhs->pt.x;
int y = pkbhs->pt.y;
if(x>= (lpRect->left+10) && x<= (lpRect->right-10) && y>= (lpRect->top+10) && y<= (lpRect->bottom-10))
{
qDebug()<<"Ddd";
return ::CallNextHookEx(mouseHook,nCode,wParam,lParam);
}
else return true;
}
...全文
1129 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
yiyefangzhou24 2018-05-18
  • 打赏
  • 举报
回复
qt? https://blog.csdn.net/hy3316597/article/details/51553330

24,854

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧