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

Get selected text

Status
Not open for further replies.

cami58

Programmer
Feb 8, 2002
16
MA
I would like to know an event or method to get a selected text from any window (Not only edit or richedit ctl).I tried with edit and richedit and i want to generalize it for any other window(For example an iexplorer window).
Thanks a lot.
 
cami58:

"Selected text" property is an "edit window" derived class window property, i.e.: the only window that has the "Selected text" property is one derived from EDIT CONTROL (like Rich Edit Control). In other words, there is no way of sending a EM_GETSELTEXT to a NON-EditControlDireved window.

As about InternetExplorer's view, it doesn't have a selected text (in the terms of an edit control). The text you can select in an IE View is a custom made feature of the view. (If you try to send a WM_GETTEXT to the IE View you will recieve nothing, because the text in IE View is not set by using WM_SETTEXT, or something like this, but is drawn by using, for example, DrawText).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top