How to get the selected text when pressing a hotkey

G

Guest

I want to write a simple utility, so that if I select a text, and press a hot
key
say (CTRL+ALT+G), then I should be able to open a google search page with
the selected text. Could someone tell me how to get the selected text when
this hotkey is pressed.
 
C

Claudio Grazioli

I want to write a simple utility, so that if I select a text, and press a hot
key
say (CTRL+ALT+G), then I should be able to open a google search page with
the selected text. Could someone tell me how to get the selected text when
this hotkey is pressed.

Well, I did something like that several years ago using VC++. What we did
was the following: When the user pressed the hotkey, we sent the keys
Ctrl+C to the currently active application. That copied the selected text
to the clipboard.
We then accessed the clipboard from our application to get the copied text.
I'm sure something like that is possible with .NET too.
 

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