Jump to content

Get High Contrast Value


Go to solution Solved by rcmaehl,

Recommended Posts

Hi all,

I'm attempting to get the high contrast setting value for Windows 8 and newer. I've found code for WIndows 7 but that really isn't useful for me. 

 

I believe I need to do something like this per https://www.autoitscript.com/autoit3/docs/libfunctions/_WinAPI_SystemParametersInfo.htm / https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-systemparametersinfoa?redirectedfrom=MSDN&f1url=%3FappId%3DDev10IDEF1%26l%3DEN-US%26k%3Dk(SystemParametersInfo);k(DevLang-C);k(TargetOS-WINDOWS)%26rd%3Dtrue

#include <WinAPISys.au3>
MsgBox(0, "", _WinAPI_SystemParametersInfo(0x0042)) ; SPI_GETHIGHCONTRAST

 

But this is returning false even with High Contrast mode enabled on my computer currently. I'll still be tweaking around in the background to try to find a solution but I'm making an obvious mistake or overlooking something help would be appreciated!

Thanks in advance!

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to comment
Share on other sites

5 minutes ago, JockoDundee said:

…call _WinAPI_GetLastError() to get extended error information…

image.png.e2703c49d6856e1d8712c1c5dc1268b7.png

Shows 0 which would be ERROR_SUCCESS

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to comment
Share on other sites

I'm thinking it may be due to something like this: https://devblogs.microsoft.com/oldnewthing/20081203-00/?p=19983 

Also examples I'm finding in powershell look like they need DllStructs or similar which I have no idea how to do

 

Edited by rcmaehl

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to comment
Share on other sites

  • Solution

For future searchers, I've worked around this using 

GUISetBkColor(_WinAPI_GetSysColor($COLOR_WINDOW))
GUICtrlSetDefColor(_WinAPI_GetSysColor($COLOR_WINDOWTEXT))
GUICtrlSetDefBKColor(_WinAPI_GetSysColor($COLOR_WINDOW))

Now I just have to figure out if I can just math hex values without issue or not

Edited by rcmaehl

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...