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
I have also saw WM_CTLCOLORMSGBOX I have put it but it didnt changed color of messagebox.How can I make them work ? Thanks
.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 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...
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
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.
Thanks for the replies.