Edit Controls - Colors - Messages
I need to know whats going on here :) I am working with edit controls. I have been trying to change the background brush on them, but cant seem to be able to access the background. I have been trying with GetClassLong and SetClassLong. This dont work, but i guess its because i havent registert the edit control and it hasnt got its on WNDCLASSEX set up. Anyway, i have managed by catching the WM_CTLCOLOREDIT and setcolor and background there. But that only works on one line of text at a time. So in the edit window procedure(subclassed), under the WM_PAINT i get the rect in the painstructure and use it in a call to FillRect to set the background color. My question is: If i take the setbk, settext..statements in the WM_CTLCOLOREDIT case and put them just before the FillRect in the subclass rutine, it dosnt work? The way i understand it is that the WM_CTLCOLOREDIT message is sent just before the paint message and would it matter where you had those statements(setbk...setText) e.g. in the WM_CTLCOLOREDIT or WM_PAINT? And is there a easier way to set the background. E.g. in a call to some function the same as GetClassLong etc....