How to get the selected text when pressing a hotkey

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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.
 
Back
Top