2

I'm working on a project which is by C# language. I want to produce a Dictionary which is similar to Narcis or Easylingo that able the user to use the mouse and just move the cursor on the WORD in any application then the program detect the word and will find the meaning for that particular word.

My question is How I can detect the word which is under the Mouse Cursor on the screen in any application such as Microsoft office or Web browsers, etc.

I'm looking for any tips and guide or any Codes which can help me.

Your cooperation is highly appreciated.

1
  • @Anand i disagree with you, it may be difficult and complicated but definitely not impossible Jun 17, 2011 at 10:51

2 Answers 2

2

You will need to fiddle with Win API capture the GDI calls that output text to the screen.

As suggested in this answer on SO,

Usually for GDI controls you can get the position and size of the control, and you can usually get the font info. For example, with static text controls you'd use WM_GETFONT. Then once you have that you can get the position of the mouse relative to the position of the control and use one of the font functions, perhaps something like GetTextExtentPoint32 to figure out what is under the cursor.

So try finding something in that direction.

0

You could possibly mimic the same features as Spy++ and capture WM_MOUSEMOVE events, pre-filter them and detect whenever the mouse is over a textbox or similar control.

It certainly won't be easy, and will take a lot of work and research!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.