mfc获取鼠标在整个屏幕上划过的信息
类似在客户区画线那样。但我要的是打开程序后即使最小化了也能捕获鼠标在桌面上滑动的信息。怎么办???????????????????????????????????????...
类似在客户区画线那样。
但我要的是打开程序后即使最小化了也能捕获鼠标在桌面上滑动的信息。
怎么办??????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????? 展开
但我要的是打开程序后即使最小化了也能捕获鼠标在桌面上滑动的信息。
怎么办??????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????? 展开
展开全部
不太明白你最终是否要获取在桌面的鼠标移动信息.
setcapture在你的窗口置入底层时,不能捕捉上层窗口信息:
Only the foreground window can capture the mouse. When a background window
attempts to do so, the window receives messages only for mouse events that occur
when the cursor hot spot is within the visible portion of the window. Also, even
if the foreground window has captured the mouse, the user can still click
another window, bringing it to the foreground
如果要简单做, 我有两个建议:
①使用全局鼠标钩子, 搜一搜不麻烦,API调用和dll生成即可
②将你的窗口最大化, 覆盖任务栏以上所有区域, 调用API设置窗口最大透明度, 即窗口完全透明
调用API设置窗口置顶, 调用setcapture, 即可捕捉任务栏以上的鼠标消息
至于计算啥点击的距离, 有了坐标, 就可以算.
setcapture在你的窗口置入底层时,不能捕捉上层窗口信息:
Only the foreground window can capture the mouse. When a background window
attempts to do so, the window receives messages only for mouse events that occur
when the cursor hot spot is within the visible portion of the window. Also, even
if the foreground window has captured the mouse, the user can still click
another window, bringing it to the foreground
如果要简单做, 我有两个建议:
①使用全局鼠标钩子, 搜一搜不麻烦,API调用和dll生成即可
②将你的窗口最大化, 覆盖任务栏以上所有区域, 调用API设置窗口最大透明度, 即窗口完全透明
调用API设置窗口置顶, 调用setcapture, 即可捕捉任务栏以上的鼠标消息
至于计算啥点击的距离, 有了坐标, 就可以算.
追问
嗯,我现在在学hook
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询