Jump to content

Recommended Posts

Posted

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, MSEdgeRedirect
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Posted
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, MSEdgeRedirect
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Posted (edited)

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, MSEdgeRedirect
Cisco FinesseGithubIRC UDFWindowEx UDF

 

  • Solution
Posted (edited)

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, MSEdgeRedirect
Cisco FinesseGithubIRC UDFWindowEx UDF

 

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
×
×
  • Create New...