   Syntax Highlighting (How?)
  I'm writing an IDE for a programming language I'm writing (I'll probably use it for scripting AI in games or writing simple tools).  Of course the IDE includes a text editor, which I would like to have syntax highlighting.  The language resembles C/C#/Java so I would like it to color certain keywords like "for", "if", and "int".Do I need to make a RichEdit control?  A little help here would be greatly appreciated.  :)Edit:  I'm coding in native C++, using only the Win32 API.   
  One thing that you might think about doing is writing a module for Visual Studio (search your msdn for babel something or other, if you have it).  I did that for my own language and it worked out fairly well.  By properly formatting your output from your compiler (if that is what you are using) you can get good error messages just like with C++.  Then with custom build events you can easily develop in your own language in Visual Studio.Otherwise, you can use a rich edit as you said.  I think you will find some things about this here at gamedev if you search (I remember something about syntax highlighting coming up).  One thing you might think of doing is lexing the text occasionally and coloring lexemes (which is kind of how you do in for visual studio).Sorry if that isn't much to go on.   ;  I'm not interesting in writing a module for Visual Studio, I'm writing a stand-alone IDE.  Actually I already have the whole IDE finished, including project files, text editors, output windows and everything - except syntax highlighting.  It's not exactly necessary, though.How do I create multi-colored Rich Edit's?   ;  The idea behind highlighting in a RichEdit is to programatically move the cursor to select the keywords, change the color for the selection, and restore the user's selection. Then, you can use lexical hightlight just fine by checking the changed lines for keywords and updating colors. Syntax highlighting involves parsing, and as such it's a little bit harder.   ;  You could look at Scintilla. It is a edit control that does syntax highlighting. You pass in all the keywords and it colours them for you. I used it once in a php editor.   ;  rate++ for scintilla. It's also bound to the wxWidgets library (great cross-platform gui library) that has both python and lua bindings. It's called something different in there though, something like wxRichTextControl or something   ;  Actually I'm looking for a small solution, parsing is no problem (all you have to do is look for keywords while excluding strings and comments, right?).  I'm curious though - how do you change the color of some text in a Rich Edit?And I'm also curious, what does "rich edit" mean?  Is it like an improved normal Win32 edit control?Edit:  (hehe..."edit...")  I just found out that a RichEdit control is an edit box that displays RTF data.  Now I just need to find out how to use it.  :)   ;Quote:Original post by ToohrVykThe idea behind highlighting in a RichEdit is to programatically move the cursor to select the keywords, change the color for the selection, and restore the user's selection. Hahahahaha, you said programatically. Sorry, I couldn't help it ;-)   ;  Look at scintilla. It has source code. The best way of doing things is usually to look at how other people do it. Then either copy it (giving credit where due) or reimplenting it if you think you can do it better / does not serve your needs.To change colour of rich edit text. Taken from MSDN// The pointer to my rich edit control.extern CRichEditCtrl* pmyRichEditCtrl;CHARFORMAT cf;// Modify the word format so that the selected word is // displayed in bold and not striked out.cf.dwMask = CFM_STRIKEOUT|CFM_BOLD;cf.dwEffects = CFE_BOLD;pmyRichEditCtrl->SetWordCharFormat(cf);;  I wrote the PHP IDE that I use at work myself, including extensive syntax highlighting.  You can read some of my comments on how I did it in this thread.   