Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# .NET WPF Win7 WinForm
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
Posted 15-Dec-11 9:26am
Comments
SAKryukov at 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.
--SA
Björn Ranft at 5-Mar-12 18:07pm
   
A 5 for this interesting question.
Rate this: bad
good
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.
  Permalink  
Comments
Mohamed_Ahmed at 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 http://www.codeproject.com/KB/dialog/FindWindow.aspx but i am thinking of, this is the beginning of the road.
Dave Kreskowiak at 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.
Rate this: bad
good
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.
  Permalink  
Comments
Mohamed_Ahmed at 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 at 16-Dec-11 7:55am
   
Google for ".net OCR" and start reading?
Rate this: bad
good
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

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
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 275
1 DamithSL 265
2 CPallini 235
3 Maciej Los 185
4 George Jonsson 170
0 OriginalGriff 5,305
1 DamithSL 4,382
2 Maciej Los 3,760
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,901


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 18 Feb 2013
Copyright © CodeProject, 1999-2014
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