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!

Can I change the colour of specified words with RichEdit

Status
Not open for further replies.

CiaranMcCormack

Programmer
Oct 7, 2002
2
IE
Hi.

I am writing a script editor or my scriptengine, and want it to look like a regular compiler. To achieve this I want key words to be highlighted, so that the script is easy to read. I have been trying to implement this within a Rich Edit. I have been looking through the help files, and found a few things but none which achieve the desired results. The closest I found was to use

SendMessage(hEdit, EM_SETCHARFORMAT, SCF_WORD | SCF_SELECTION, (LPARAM) &cfm);

This will change the text colour of the text which is currently highlighted by the mouse. Is there any way to achieve this automatically so that all instance of int, float, void etc... will appear in a specified colour.

Thanks
Ciaran

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top