I've made a ColorButton
subclass of CButton
, setting BS_OWNERDRAW
flag in styles.
It works fine: I can set its text, background, etc. etc.
However I don't want to have to set the minor colors manually (highlight, shadow, etc.) I have a heuristic to choose white or black for text based on background. I could do the same for the other minor colors but my formulas would differ from what Windows would do were the same color the background, and thus look odd. So:
Question: Is there any way to find out what Windows would return for GetSysColor(COLOR_BTNSHADOW)
with a given background color?
To anticipate an answer I see CMFCButton
allows custom colors without making a whole subclass. What I've seen again allows the micromanagement of setting every color, but not the high-level ability I'm looking for. I'd may rather stick with my solution as it's already running, and works on XP and later. (This is a freeware utility so who knows what old OS users might have.) That said, If there's a CMFCButton
solution that would also be of interest.