471,092 Members | 983 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,092 software developers and data experts.

How to get the selected text when pressing a hotkey

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.
Jul 21 '05 #1
1 1705
On Fri, 18 Mar 2005 04:49:05 -0800, Nitesh Jain wrote:
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.

--
Claudio Grazioli
http://www.grazioli.ch
Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Marcus Peters | last post: by
3 posts views Thread by Rsrany | last post: by
reply views Thread by NvrBst | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.