rcmaehl Posted June 25, 2021 Share Posted June 25, 2021 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 WhyNotWin11Cisco Finesse, Github, IRC UDF, WindowEx UDF Link to comment Share on other sites More sharing options...
JockoDundee Posted June 25, 2021 Share Posted June 25, 2021 12 minutes ago, rcmaehl said: But this is returning false even with High Contrast mode enabled on my computer currently …call _WinAPI_GetLastError() to get extended error information… Code hard, but don’t hard code... Link to comment Share on other sites More sharing options...
rcmaehl Posted June 25, 2021 Author Share Posted June 25, 2021 5 minutes ago, JockoDundee said: …call _WinAPI_GetLastError() to get extended error information… 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 WhyNotWin11Cisco Finesse, Github, IRC UDF, WindowEx UDF Link to comment Share on other sites More sharing options...
rcmaehl Posted June 25, 2021 Author Share Posted June 25, 2021 (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 June 25, 2021 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 WhyNotWin11Cisco Finesse, Github, IRC UDF, WindowEx UDF Link to comment Share on other sites More sharing options...
Solution rcmaehl Posted June 26, 2021 Author Solution Share Posted June 26, 2021 (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 June 26, 2021 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 WhyNotWin11Cisco Finesse, Github, IRC UDF, WindowEx UDF Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now