Click here to Skip to main content
11,928,078 members (26,823 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# Windows .NET WPF Win7
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[^]

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
Posted 15-Dec-11 9:26am
SAKryukov 15-Dec-11 14:33pm
Good question just because of its challenge, voted 5. I don't say this is impossible, but it looks very difficult to me.
Björn Ranft 5-Mar-12 18:07pm
A 5 for this interesting question.
Rate this: bad
Please Sign up or sign in to vote.

Solution 5

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

what are classes
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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.
Mohamed_Ahmed 16-Dec-11 3:55am
Thank you Dave Kreskowiak, ok i worked before with image processing but i never worked before with OCR can you tell me how to begin.
Dave Kreskowiak 16-Dec-11 7:55am
Google for ".net OCR" and start reading?
El_Codero 11-Jun-15 6:52am
high fived :)
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.
Mohamed_Ahmed 15-Dec-11 15:08pm
Thank you Marcus Kramer and SAKryukov i was thinking of this:
1- take a snapshoot of the screen
2- analyze the image (bitmap) by any ocs program or even create my own, to get all the words in the screen
3- map the mouse location with the image and determine the word
but this is a very long way and not powerful at all
and this is a very old and bad school
But now, i found this but i am thinking of, this is the beginning of the road.
Dave Kreskowiak 15-Dec-11 15:22pm
The problem with using the technique in that article is that 1) not every window suppors WM_GETTEXT and 2) WM_GETTEXT does not let you get the text mapped at a certain location.

OCR is going to be your best option, and no, you don't have to capture the entire screen image, just a smaller section around the mouse.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web04 | 2.8.151126.1 | Last Updated 11 Jun 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100