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

Get current word from Rich Edit

Status
Not open for further replies.

CiaranMcCormack

Programmer
Oct 7, 2002
2
IE
Hi.

Is there any way to get the current word which is being typed from a rich edit. The only way that I can see to "get" words is to use the Function

SendMessage( hwndEdit, EM_GETSELTEXT, 0, lpszBuffer );

but in-order for this to work, you first need to select the word/text with the mouse. I dont want to have to select it, but for it to work automatically on the current word being typed.

I have been looking through other messages, and found one which makes me think that it is possible. In the EM_SETCHARFORMAT message one of the options is SCF_WORD | SCF_SELECTION which is described as Applies the formatting to the selected word or words. If the selection is empty but the insertion point is inside a word, the formatting is applied to the word. Given that this can modify the current word without it being selected, it leads me to belive that it is possible to retrieve this word somehow.

Thanks
Ciaran
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top