检测编程任务栏上/​​窗口标题鼠标悬停(的WinForms / C#) [英] Programmatically detecting mouse hover over taskbar/window caption (winforms/C#)

查看:143
本文介绍了检测编程任务栏上/​​窗口标题鼠标悬停(的WinForms / C#)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想找出是否鼠标悬停在任务栏按钮,并属于该按钮的窗口的标题/ HWND。例如。如果通过任务栏按钮移动鼠标,你得到这个名字的提示 - ?所以这应该是可以很容易

I want to find out if the mouse is hovering over a taskbar button, and the caption / hwnd of the window that belongs to the button. E.g. if you move the mouse over a taskbar button, you get the tooltip with the name - so this should be possible fairly easily?

推荐答案

为了解决这个任务,你应该监视使用Win32 API的钩子explorer.exe的传入消息。如果你不知道的Win32 API的话,我建议你读一本书,并花了一些时间练习,因为Win32 API的和它的钩子不能在这个问题的答案的短词来解释。

To solve that task you should monitor explorer.exe incoming messages using Win32 API hooks. If you don't know about Win32 API then I suggest you to read a book about it and spent some time practicing, because Win32 API and its hooks can not be explained in short words of that answer.

C#是不是做sush样的东西,一个合适的工具,至少挂钩必须C(++)来完成,所以你需要了解它。实事求是地说,的Win32 API与C一起的,学习(++)可能花了一年或两年成为可解任务之前。

C# is not a right tool to do sush sort of things, at least hooking must be done in C(++), so you need to learn it. Realistically speaking, that learning of Win32 API together with C(++) may took a year or two before the task become solvable.

这篇关于检测编程任务栏上/​​窗口标题鼠标悬停(的WinForms / C#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆