I'm trying to change the background color of a dialog box (win 7, vs2010,c++). I tried to catch WM_CTLCOLOR ,WM_ERASEBKGND and change the color. I manged to change in this way the backgroung color, but when the window is finish to upload itself, the color is back to default but I noticed that the frame is in the right color. I think that I'm changing the window and not the dialog box or something like that. I'm doing this with WTL (not AFX).
What should I do?
Try this:
And have a look here ... and most important : here
The better way will be to override WM_CTLCOLOR, background of controls such as STATIC will be fill with your color too.
Hi the above answer will work only if you don't have tab inside dialog box it will color background of dialog box other the tab portion. for tab portion you have to create new derived class with base class CTabCtrl.