High Contrast Mode is not the same as High Contrast Scheme

"High Contrast Mode" is an accessibility state controlled by the HCF_HIGHCONTRASTON flag in the dwFlags member of the HIGHCONTRAST structure. You can retrieve this structure programmatically by calling the SystemParametersInfo function with the SPI_GETHIGHCONTRAST parameter; conversely, you update the setting programmatically with SPI_SETHIGHCONTRAST parameter. Programs are on their honor to query the "High Contrast Mode" flag and, if set, simplify their display so as to be more usable to people with low visual acuity. For example, gradients and background bitmaps should be turned off and system colors should be used for screen elements.

End users can enter and exit "High Contrast Mode" by going to the Accessibility control panel and checking or unchecking the "High Contrast" box. Alternative, users can use the High Contrast Mode hotkey, LeftShift+LeftAlt+PrtSc. As an added bonus (and here's where the confusion begins), if users employ the hotkey, then the system will also switch to or from the "High Contrast" color scheme automatically.

The "High Contrast" color scheme (or more accurately, schemes, since there are a few of them) is a collection of colors and metrics that are suitable for users with low visual acuity. You can manually select this color scheme from the Display control panel's "Appearance" page.

These two concepts, "High Contrast Mode" and the "High Contrast Color Scheme" are independent. You can be in High Contrast Mode with normal colors. (This means that programs will remove visual distractions even though your screen colors aren't black and white.) Or you can use the High Contrast Color Scheme without being in High Contrast Mode. (This means that your screen colors are predominantly black and white, but programs are still welcome to use gradients and background bitmaps.)

It turns out that these "mixed states" are very confusing to end users. When users go to the Display control panel and select a High Contrast color scheme, they almost certainly want to go into High Contrast Mode as well, but that doesn't happen because the Display control panel says, "Well, you're choosing some colors that are very heavy on black and white. Maybe you just like those colors? Perhaps you're a fan of penguins, or maybe you're just into goth fashion. I'm just the Display control panel; I change colors. I don't do accessibility stuff. For that, use the Accessibility control panel. Not my job. Clear delineation of responsibility."

It's perfectly logical and completely counter-intuitive.

Most often, I see this when somebody sets their color scheme to High Contrast from the Display control panel, and yet they find that programs are not recognizing High Contrast Mode and are still using gradients and background bitmaps.

As a result of this confusion, many programs don't trust SPI_GETHIGHCONTRAST. Or, more accurately, if SPI_GETHIGHCONTRAST says, "No, High Contrast Mode is not enabled," the programs say, "Well, okay, we're not in High Contrast Mode, but maybe we're in the mixed case where users chose the High Contrast color scheme and think that they are in High Contrast Mode even though they technically aren't." These programs study your current colors, do some math, and decide if they are "high contrast-y". If so, then they go into "virtual High Contrast Mode", where they act as if HCF_HIGHCONTRASTON were set even though it really isn't.

As a result of these programs "trying to guess what you really want", I occasionally see somebody complaining, "After I set my colors to my personal preferences (stark black and white because I like it that way), some programs think I'm a person with visual impairments and go into a simplified visual mode."

Windows Vista attempts to resolve this confusion by violating the "architectural purity" of the Display control panel and having it set and clear the High Contrast Mode flag depending on what color scheme you picked. If you pick a High Contrast color scheme, then the Display control panel will automatically set you into High Contrast Mode. Because it's almost certainly what you wanted anyway.

Comments (15)
  1. mvadu says:

    As a result of these programs “trying to guess what you really want”, I occasionally see somebody complaining, “After I set my colors to my personal preferences (stark black and white because I like it that way), some programs think I’m a person with visual impairments and go into a simplified visual mode.”

    So Windows Vista joined these guessing programs list. So how that solves the problems somebody had, when they said some programs think they have visual impairments while they just like the black and white colors and not the High Contrast Mode.

    “Because it’s almost certainly what you wanted anyway.”

    No It is not, you only blamed programs assuming this, and behaving as if they are in High Contrast Mode, while user just wanted color scheme.

  2. nathan_works says:

    I wonder how many ADA lawsuits came about over this issue.

    Another reason, in a long, long, long, long, long list of reasons, why I dislike ever writing any UI code.

  3. Leo Davidson says:


    I expect the control panel sets the flag iff you select one of the named high contrast colour schemes. If, instead, you start from a different scheme and set the colours to black & white (or whatever) then I expect the flag will not be set.

    I haven’t tested it but that’s my assumption from what Raymond said and how I would have implemented it myself.

  4. SRS says:

    Does Vista Aero support the ‘High Contrast Mode’ or does this cause a switch to some sort of Vista Basic mode?

    (I don’t have access to a Vista installation, so can’t test for myself.)

  5. mm says:

    I agree on the change.

    On the other hand, setting high contrast mode and then getting back to normal, Vista forgets my color settings (I have Aero with custom colors for selection, titlebar and window decoration/transparency).

  6. John says:

    What about a No Contrast Scheme?  You can choose whatever colors you like, as long as they are black (or white for our Different friends).

  7. chrismcb says:

    One of the biggest problems with color selection is all of the default colors (with exception of High Contrast Black) use white as a background. Of course MANY programs assume your background is white. If you don’t use a foreground color that contrasts with white, you are in danger of not being able to read your text.

    I once worked on a big software product, and I preferred yellow test on black background. I constantly saw these "assume background is white bugs." But every time I logged a bug, I was asked "does it work in high contrast mode." So the tester would set it to High Contrast Black (setting the bit) and say yeah it works, bug is won’t fix.

    Completely ignoring the fact that I don’t want the bit set, I just want to flip flop the background/foreground colors.

  8. Ian says:

    Oh dear, oh dear.

    It seems that I just fell into the "High Contrast Mode is not the same as High Contrast Scheme" trap.

    The effect I saw was nothing more than the application of the high contrast colour theme. The HCF_HIGHCONTRASTON flag on its own doesn’t seem to do anything.

  9. ender says:

    chrismcb: welcome to the club. I’ve been using an inverted colour scheme for a few years now, as it’s easier on my eyes, and there’s a ton of programs that expect either that the background is white, or that the text is black. Then again, having the EULAs invisible isn’t that bad.

    It’s funnier when some programs try to do gradients between colours, and apparently overflow somewhere, making the gradients full of rainbows.

  10. Dog says:

    So how is this implemented in Vista?

    Does it have a hard-coded set of colour schemes that activate high-contrast mode, or is there a "this is a high contrast scheme" attribute in the colour scheme definition?

    IMHO, the latter would be better and I wouldn’t consider it having any sort of architectural purity issues… So am to I assume then that it’s been implemented in the former manner?

  11. Andrew says:

    Aha! So Microsoft actually listened to its users for once and changed Windows behaviour to better match user expectations? At the risk of sounding like a troll, can someone tell me why this is OK, but officially the tray is still not the tray?

  12. SCB says:

    So, let me see if I understand this correctly.

    Prior to Windows Vista, "High Contrast Color Scheme" is just another color scheme, and is treated in the same way as any other color scheme.

    Whereas "High Contrast Mode" is a completely independent flag set for the benefit of application programs that may want to draw things on the screen.

    In Windows Vista, "High Contrast" color schemes are treated differently from other color schemes, in that selecting one will cause the "High Contrast Mode" flag to become set.

    Is that right?

  13. Ian says:

    "Programs are on their honor to query the "High Contrast Mode" flag and, if set, simplify their display"

    I wonder how many applications actually do this? I had never heard of this before and I have certainly never in my life written any code to look for HCF_HIGHCONTRASTON.

    Well, I’ve just tested one of my recent creations, and it seems that it *does* honour high-contrast mode. Presumably the Windows common controls give you this functionality for free, so that you only need to check the flag yourself if you are doing custom drawing…?

  14. Duncan says:

    SRS – "Does Vista Aero support the ‘High Contrast Mode’ or does this cause a switch to some sort of Vista Basic mode?"

    Aero is turned off when High Contrast Mode is used.

  15. Dustman says:

    Wow. Raymond’s so old, he still thinks it’s called goth! And I thought I was the only one.

Comments are closed.

Skip to main content