Search code examples
windowscolorsc++-clisystemcolors

How do I undo SetSysColors()?


So I executed:

int elements[2] = {COLOR_HIGHLIGHT,COLOR_HIGHLIGHTTEXT};
DWORD newColors[2];

newColors[0] = Color::IndianRed.ToArgb();
newColors[1] = Color::Maroon.ToArgb();

SetSysColors(2,elements,newColors);

I thought it might do what I hoped it wouldn't.. but it did so now everything I select looks like this:

enter image description here

What are the default values for my system to set it back to how it was? I am running Windows 10.


Solution

  • Quoting MSDN:

    However, this function affects only the current session. The new colors are not saved when the system terminates.

    Just reboot your machine.