If I'm using the default system font, which is not symmetrical, how can I print a list of 3 items per line, where the 3rd item is GREEN?
So, I'm doing a 'lstrcat' to create the line, and I can print out the first 2 items in black, but then I have to figure out what pixel the 3rd item starts. There has to be a better way than that.
Maybe something like this.
Test123 - Test456 - GREEN
Test12 - Test12 - RED
Test123456 - Test123456 - BLUE
I'm using TextOut, but is there a way to create a text line with different color attributes for each character?
SetTextColor and SetBkColor could/should work with DrawText/TextOut, I have never had a need so haven't actually tried, but doing it for individual characters is likely to be a VERY tedious and error-prone exercise in head banging futility. You'd make repeated calls to the functions to draw each individual character to the client area's device context.
It still won't be a simple, easy route. Look at what's involved with changing colors in a Win console. That's dealing with characters at a simpler level than fonts in a WinAPI app. http://www.cplusplus.com/articles/Eyhv0pDG/
Thanks for the responses. I think I'll just spread out my display like a table and print out individual items in the various colors. It seems like a real pain to print a text line with different word or phrase colors.