qt 鼠标钩子报错
我想写一个鼠标钩子,作用是只允许鼠标在顶层窗口有效。上面不知道出了什么问题,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;
}