I am usigin .rc file to make my dialog and buttons I have changed colors of dialog and static control but not button.This is the code I have tried

.ELSEIF  uMsg==WM_CTLCOLORBTN  || uMsg==WM_CTLCOLORDLG  || uMsg==WM_CTLCOLORSTATIC
invoke SetTextColor,wParam,White   
invoke SetBkColor,wParam,Black
invoke GetStockObject,BLACK_BRUSH
ret
I have also saw WM_CTLCOLORMSGBOX I have put it but it didnt changed color of messagebox.How can I make them work ? Thanks
Posted on 2001-06-14 11:15:00 by LaptoniC
I have heard somewhere that is impossible to do... but it's only rumors... VB and Delphi uses custom buttons, so they are able to do it... but not with standard control... I never tried to do that thing, though...
Posted on 2001-06-14 13:19:00 by Readiosys
Well, the text back color and the brush color are two different things. SetBkColor = Set text background color SetBkMode = Set text background mode (transparent/opaque) You should set the text background mode to transparent, and then set the brush using SelectObject and causing the window to receive a WM_ERASEBKGND message by using InvalidateRect. That's the most I can recommend
Posted on 2001-06-17 03:14:00 by pellybelly
LaptoniC, your doing the right thing, however Readiosys is right you can't change button colours. Its says into the win32 Api reference that even though you recieve a WM_CTLCOLORBTN message you can only use this to change the text colour. SetBkColor has no effect. I once made custom buttons by subclassing a static box if that any help.
Posted on 2001-06-17 08:01:00 by Zadkiel
Thanks for the replies.
Posted on 2001-06-17 17:25:00 by LaptoniC