Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application Focus

Status
Not open for further replies.

Lfelipe

Programmer
Nov 6, 2002
3
BR
Hi all !

I want to develop a Babylon-like(translator) application.
I´d be glad if i could find help for the following questions:

(1) How to set the focus for my application by the press of a key combination (like shift + d).
Eg: The user is reading a Word document and when he/she presses Shift+D my application, which is on the System Tray, is restored.

(2) How to get the content of a highlighted text in any application (Word,Acrobat Reader, Notepad,...).
PS: without having to copy it to the Clipboard.

Thank u all !
Luis Felipe

 
You're going to want to use hooks to accomplish all of this. The code is too much to pst here. Just do a quick search for windows hooks and bcb and see what you can't find. Also, try the archived zips on the website for Borland C++ Builder Developers Journal. I know they had a few very good examples of using windows hooks to accomplish what you're talking about.

To set the focus, I think you call a function like RegisterHotKey or something to that extent. It's a Windows hotkey issue. I'll try to find the code later tonight when I'm at my home computer. Cyprus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top