I am trying to change my application\' s title bar and border colors programmatically. I tried lots of things but with no success, and decided to change these colors system-
I don't recommend to customize border and title redrawing. It's really hard to do it the right way. Office just draws everything by itself in the client area but using normal border. Using NC_PAINT the right way is a pain and may introduce flickering. Especially positioning the minimize,maximize and close buttons is difficult, because every windows does it differently. Also take into account accessibility, larger fonts used, customized user settings.
Whats the purpose of changing the colors?
To change the global colors you have to at least separate your code
// call this once at startup of your application (e.g. in WM_CREATE)
SetSysColors(2, aElements, aNewColors);
// call this when closing you application (e.g. in WM_DESTROY)
SetSysColors(2, aElements, aOldColors);