Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Limits SetSysColor to one application

Tags:

c++

c

winapi

mfc

gdi

I want to change the set of colors used in my software. My research led me to the SetSysColor() function. The problem with this function is that every software on the computer gets affected by the modification, not only the executable I want to modify.

Is there a way, or a alternative, to change the set of colors used by my application without having to redraw everything manually?

like image 986
Pumkko Avatar asked Feb 01 '26 06:02

Pumkko


1 Answers

In some cases using custom colors may indeed be beneficial (highlighting, notifications, color-coding etc); just don't overdo. There are certain ways in WinAPI (usually accessible in MFC too - through events or direct WIndows message handlers) that let customize the appearance of your application. Look into the documentation for own-drawn controls, custom control colors, WIndows Class brushes, messages like WM_CTLCOLOR and WM_ERASEBKGND, You can also customize the looks of a window's non-client area (eg title-bar, borders etc), although this changes the appearance of your app a lot more drastically. See messages like NC_PAINT and NC_HITTEST.

like image 79
Constantine Georgiou Avatar answered Feb 02 '26 22:02

Constantine Georgiou