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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can i get SELECTED text from another application?

Status
Not open for further replies.

alex14

Programmer
Apr 5, 2002
10
0
0
UA
Description: My application has registered hot key (done with help of RegisterHotKey).
After pressing hot key combination I simulate (with help of SendInput) Ctrl+Insert
keyboard input and then I read clipboard. This works well if user presses hot key
combination in MS Word or in Notepad but if hot key is pressed for example in Internet
Explorer or in Outlook Express the selected text come to clipboard in about 1.5 second
(incredible!);and therefore in run-time when clipboard is read I get the previous (old)
content of clipboard. From another hand I can not wait for 1.5 second to get updated
content of clipboard because it too long for any user to wait.
 
I'm interesting at the same thing as you that's my problem too to get a selected text from an other application.If you want to get a selected text from just an edit view you can send a message WM_GETSELTEXT to the window you want to get text from.But this will not work with IExplorer.
For the Explorer simulate a WM_COMMAND with WPARAM as 0xA042 and LPARAM=0 to the parent window (IEFrame) and that works cause you will just call the copy from the menu.
That's my points now and I'm still working to get something better.
If you get any other Ideas It would be helpfull for me.
c.ami@caramail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top