Get button color from theme
-
I have just added a manifest to my project so that I can get the XP theme. I am having trouble getting the button colors so that my owner-drawn buttons can conform to the theme. I have tried GetThemeSysColor( hTheme, COLOR_BTNFACE ) but it doesn't return the correct value. I'm currently hard-coding (yuk) the RGB values for the button color in it's pressed and unpressed states but most certainly would like to be able to get the value programatically. any ideas? cje cje
-
I have just added a manifest to my project so that I can get the XP theme. I am having trouble getting the button colors so that my owner-drawn buttons can conform to the theme. I have tried GetThemeSysColor( hTheme, COLOR_BTNFACE ) but it doesn't return the correct value. I'm currently hard-coding (yuk) the RGB values for the button color in it's pressed and unpressed states but most certainly would like to be able to get the value programatically. any ideas? cje cje
The proper identifier is TMT_BTNFACE, which has a different value than COLOR_BTNFACE. Also note that button faces in the XP themes may have a gradiant, not a single color. If you want the same look, check out DrawThemeBackground or related functions. Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke