当鼠标悬停在窗口中的任何单词上时,都会给出单词 [英] When mouse hover over any word in the windows give me the word

查看:96
本文介绍了当鼠标悬停在窗口中的任何单词上时,都会给出单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI全部,



i我正在尝试这样做,当用户将鼠标悬停在系统中的任何单词上时,程序必须告诉我你将鼠标悬停在X字上







如果有人不想说这是不可能你可以看到< a href =http://www.verbace.com/> http://www.verbace.com/ [ ^ ]



这是一本字典,当你将鼠标悬停在windows中的任何单词上时,他都会给你翻译< br $>


i不知道如何开始,请帮助



任何帮助将不胜感激

解决方案

是的,它可以通过使用win32 API来完成。

有一个win32 API,它返回特定窗口的句柄或者可以返回

运行窗口的类名。

首先你需要确定窗口的句柄或类名,它位于

鼠标p下面ointer然后你可以得到这个窗口的文本或窗口的信息。

你的初始点是



  http:  //   www.c-sharpcorner。 com / UploadFile / shrijeetnair / win32api12062005005528AM / win32api.aspx  

classes

http: // www.vb-helper.com/howto_get_window_info_under_mouse.html


是的,这是可能的,但不容易实现。



我能在系统的任何窗口看到这个文本的唯一方法就是如果你使用OCR技术获取鼠标悬停的可能单词的边界,调整边界作为neede d提出候选词,查找候选词,根据需要进行调整并重复,但在某些范围内。您真的不想尝试将整个屏幕视为单个单词并查看它。


步骤1是了解鼠标悬停事件。

第2步是使用鼠标悬停事件和鼠标位置来决定用户悬停在哪个单词上。

步骤3是在确定后执行您想要做的事情。



继续尝试建立这个。如果您对此过程中的某些内容有更具体的问题,请随时提出,我们将非常乐意为您提供帮助。



欢呼和祝你好运。

HI All,

i am trying do this, when the user hover over any word in the system, the program must tell me you hovering over the X word



if any one wan't to say this is can't be done you can see http://www.verbace.com/[^]

this is a dictionary when you hover over any word in the windows he gave you the translation

i don't know how to start, Please Help

any help will be appreciated

解决方案

yes it can be done using by using win32 API.
there is a win32 API which return you the handle of specific windows or that can return the
class name of the running windows.
first you have to identify the handle or class name of the window which is under the
mouse pointer then you can get the text of this window or information about the window.
your initial point is

http://www.c-sharpcorner.com/UploadFile/shrijeetnair/win32api12062005005528AM/win32api.aspx

what are classes

http://www.vb-helper.com/howto_get_window_info_under_mouse.html


Yeah, this is possible, but not easy to pull off.

The only way I can see this working for the text in any window in the system is if you used OCR techniques to get the boundries of the POSSIBLE word the mouse is hovering over, adjust the boundries as needed to come up with a word candidate, lookup those candidates, adjust as necessary and repeat, but within certain bounds. You really don't want to try and treat the entire screen as a single word and look that up.


Step 1 is to understand the mouseover events.
Step 2 is to use the mouseover event and mouse position to decide what word the user is hovering over.
Step 3 is to do what you want to do once this has been determined.

Go ahead and try to build this. When you have a more specific question regarding something in the process, feel free to ask and we'll be more than happy to help.

Cheers and good luck.


这篇关于当鼠标悬停在窗口中的任何单词上时,都会给出单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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