views:

26

answers:

2

how do I detect whether windows is in high contrast mode, or it displays large font or extra large font?

I need to provide accessibility support in my javascript.

Thanks.

+1  A: 

See this post.

in high contrast mode on Windows, background images should be set to "none" and it also changes the background color. This should override any CSS stylesheet. So you can perform some javascript to detect it after initial rendering.

Edit: You said you actually want to do this in Java. This has been covered before on SO:

Turns out the win.highContrast.on property was added in Java 1.4.1 for this purpose.

Simon Brown
Hi, I am using a WebBrowser widget within some Java code to render the HTML. I need to pass the windows OS theme setting from the java side to the CSS side. On the java side, how do I detect whether the windows theme is high contrast?Thanks....
Java Doe
In that case, you should retag your question as [java]. Still, i've edited my answer.
Simon Brown
A: 

Try SystemParametersInfo function with the following parameters:

  • SPI_GETHIGHCONTRAST
  • SPI_GETICONTITLELOGFONT
valdo
The question refers to javascript.
Simon Brown
The question is poorly written, but it does say that in the keywords.
jeffamaphone