When i use that function, the color of the text never change, except if i use inside WM_CTLCOLOREDIT...
How to make it work outside? thanks =]
When i use that function, the color of the text never change, except if i use inside WM_CTLCOLOREDIT...
How to make it work outside? thanks =]
If you are using it with a control, that's really the only effectively simple place to use it. Another option is to subclass the control in question but you may end up having to handle the entire drawing for the control as attempts to CallWindowProc for default system rendering may sometimes result in changes you've made being overridden. A third option, if you're confronted with having to draw the control yourself, is to owner-draw it; refer to the individual control documentation on msdn for how to do this.
CProgramming FAQ
Caution: this person may be a carrier of the misinformation virus.
Try this.
go here for more info.case WM_CTLCOLOREDIT:
hdc = (HDC)wParam;
SetTextColor(hdc, RGB(255,0,0)); // red
SetBkColor(hdc, RGB(255,255,0)); // yellow
return GetSysColorBrush(COLOR_3DHILIGHT); // hilight colour
http://www.catch22.net/tuts/tips.asp#EditColour
Its Really All up to you.
unkownname, Tropicalia said that he already can get it to work in WM_CTLCOLOREDIT.
Try
Code:case WM_XXX: // Never use this code in WM_PAINT. HDC hdc = GetDC(hwnd); SetTextColor(hdc, RGB(255,0,0)); // red SetBkColor(hdc, RGB(255,255,0)); // yellow break;