I need a solution to the following problem: custom color the caption bar of an MDI application without using SetSysColor to override the system color set.
I've done the searching and seen code up on Code Project an the like that do an OK job of what I want, the problem is that most of it was never implemented or tested with WinXP Themes in mind and therefore breaks gloriously. I've tried tinkering with them in order to fix the problems, but can't get things like the Min/Max/Restore/Exit buttons to ever work or draw quite right. Either the XP buttons show up (which is ugly), or if I manually disable themes in the application, the buttons end up all jacked up as appear only half as wide as they should when you click on them.
It amazes me that there is no API to do this inherently in MFC, as it seems like it should be something fairly easy to do. SetSysColor works well enough, until you bring in the fact that it also changes the color of every other application as well. While you could caption OnActivate and switch back the colors to the system default, it's not very robust as the colors don't get reset when the application crashes or is terminated early while debugging.
Any help would be appreciated.
I've done the searching and seen code up on Code Project an the like that do an OK job of what I want, the problem is that most of it was never implemented or tested with WinXP Themes in mind and therefore breaks gloriously. I've tried tinkering with them in order to fix the problems, but can't get things like the Min/Max/Restore/Exit buttons to ever work or draw quite right. Either the XP buttons show up (which is ugly), or if I manually disable themes in the application, the buttons end up all jacked up as appear only half as wide as they should when you click on them.
It amazes me that there is no API to do this inherently in MFC, as it seems like it should be something fairly easy to do. SetSysColor works well enough, until you bring in the fact that it also changes the color of every other application as well. While you could caption OnActivate and switch back the colors to the system default, it's not very robust as the colors don't get reset when the application crashes or is terminated early while debugging.
Any help would be appreciated.