I have been able to change the background of my dialog as well as the static controls, but now the "Close" button sticks out. How do I change the button color to match that of the dialog?
PEASLEE,
Button (Control Library), MSDN (https://msdn.microsoft.com/en-us/library/windows/desktop/bb775943(v=vs.85).aspx)
WM_CTLCOLORBTN Message (https://msdn.microsoft.com/en-us/library/windows/desktop/bb761849(v=vs.85).aspx)
Zen,
I found that earlier because a similar message works for static controls. I cannot get WM_CTLCOLORBTN to work. Some folks on the web say it has been eliminated, some that it requires an owner draw button, and some say it never worked.
What I would like would be a simple working example.
Thanks for the response.
i don't remember ever seeing it work - lol
the button is a tough one - especially on windows 7 or later
the actual button window is a child of a child "worker" window
so, subclassing it is no easy task, either
i've found that, rather than subclassing, write your own button window :t
It's tricky indeed. Here (http://www.programmingforums.org/thread10678.html) they claim that buttons with any *push style can change colours, but I can't confirm that for Win7-64. Besides, notify/NM_CUSTOMDRAW is being proposed.
You could try changing the button style to one where you can control the color.
SetWindowLongPtr (https://msdn.microsoft.com/en-us/library/windows/desktop/ms644898(v=vs.85).aspx)
And if you need to know what the style, or whatever, is GetWindowLongPtr (https://msdn.microsoft.com/en-us/library/windows/desktop/ms633585(v=vs.85).aspx).