Catching events outside the application...

B

Billy Porter

How would I go about catching events outside my application?

Example: Babylon Pro is a program that runs silently (with a hidden GUI) in
the system tray. Whenever you use the keyboard/mouse combination CTRL+Right
mouse click (in ANY program), the GUI is shown containing the dictionary
lookup of the marked word.

If I were to write such an application, how could I catch that particular
keyboard combination outside of my application.

Thanks!
 
C

Chris R. Timmons

How would I go about catching events outside my application?

Example: Babylon Pro is a program that runs silently (with a
hidden GUI) in the system tray. Whenever you use the
keyboard/mouse combination CTRL+Right mouse click (in ANY
program), the GUI is shown containing the dictionary lookup of
the marked word.

If I were to write such an application, how could I catch that
particular keyboard combination outside of my application.

http://www.dotnet2themax.com/ShowContent.aspx?ID=af74e0ef-3b10-4c7c-8e4b-df9a75f30944
 
B

Billy Porter

Thank you so much, thats just what I was looking for!

Just one more thing: Is there any way to get the word that was clicked on
(just like Babylon)? See my former post for more information.

Thanks again!
 
C

Chris R. Timmons

Thank you so much, thats just what I was looking for!

Just one more thing: Is there any way to get the word that was
clicked on (just like Babylon)? See my former post for more
information.

Billy,

I'm not sure how that's done. I think you would need to get the
current mouse position (System.Windows.Forms.Cursor.Postion), and
then use the Windows API to get the handle of the window at that
position. Using that handle, check if the window is some kind of
text box. If it is, ideally the textbox would have some kind of
method you could query to have it tell you what word (if any) the
mouse cursor is hovering over.

I don't know exactly how Babylon is getting the word under the
cursor, but it is probably a much more complicated process than
what I just described. Here's an opinion from Peter Below, a
highly respected Delphi and Windows API expert, on this very topic:

http://groups.google.com/group/borl...+group:*win32*&rnum=58&hl=en#d5343dabcaf8376c

or

http://tinyurl.com/8fvnh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top