-
-
Notifications
You must be signed in to change notification settings - Fork 59
Feature ideas : add support for High Contrast mode. #40
Comments
That is great! I'll work on it when you post the documentation. |
I will try to quickly provide you with the necessary documentation (probably in the coming days). |
I am finalizing version This /// <summary>
/// Enable or disable the high contrast mode.
/// </summary>
/// <param name="enable"></param>
/// <returns></returns>
public static bool SetHighContrast(bool enable)
{
HIGHCONTRAST highContrast = new()
{
cbSize = Marshal.SizeOf(typeof(User32.HIGHCONTRAST)),
dwFlags = enable ? 0x1u : 0x0u // Set to HCF_HIGHCONTRASTON to enable, 0 to disable
};
return User32.SystemParametersInfo(0x0043 /*User32.SPI.SPI_SETHIGHCONTRAST*/, highContrast.cbSize, ref highContrast, 0x01 | 0x02);
}
[StructLayout(LayoutKind.Sequential)]
public struct HIGHCONTRAST
{
public int cbSize;
[MarshalAs(UnmanagedType.U4)]
public uint dwFlags;
public string lpszDefaultScheme;
} Unfortunately, customizing colors is not working as it should. To make colors synchronized with the system, I should apply classic colors two or more times, and sometimes not applied at all, and this won't be suitable for users. |
This feature is coming soon in a new update. |
Thank you for these changes, and sorry for having forgotten this discussion a little... |
Regarding the synchronization problem, it may be because of the registry keys in which WinPaletter writes. |
After testing, I noticed that the colors applied (regardless of the selected scheme) are those of the previous high contrast theme applied with the default theme engine. For example, I had just applied the High Contrast White theme with the system, then switched to Windows Aero (so I was no longer in high contrast mode). Then, I activated the high contrast with WinPaletter, keeping the same color scheme (Aero fallback); the majority of the colors went to High Contrast White. The only colors that apply seem to be those that are not managed by the visual style and therefore appear all the time (like the window background), and the colors on "modern" elements (UWP type). |
If you want a screen recording of that, I can provide it. |
If this is possible, then please post it so that I can understand it more, or write steps to be made into the Windows Registry. |
Here is the screen recording : UkqyPflWic.mp4The theme applied is the default Windows theme (including AeroFallback). The last high contrast theme applied was HighContrastWhite. When enabling high contrast mode with WinPaletter, the following are correctly applied: Metro/UWP, Win32 with classic theme and DWM title bar. In contrast, Win32 elements dependent on the visual style are displayed with the colors of the previous high contrast theme (here High contrast white). |
The high contrast mode is a mode introduced in Windows 8, to compensate for the discontinuation of support for the classic theme for visually impaired users. For Win32 programs, it uses the Aero Lite visual style in a particular mode (much like Aero's "Dark" mode), which forces rendering by Win32 color settings. In UWP/WinUI apps, it forces the use of Win32 color settings, which is the only way, since UWP apps don't work with the classic theme. The parameters used are only certain colors, less than with the classic theme. Tomorrow I will post the links to the Microsoft documentation on this subject, as well as the research I have done on the parameters used, and the results on the Win32 and UWP type elements and for the Windows 10 taskbar and start menu (I don't is not sought for Windows 8 and 11).
It seems to me that the result Win32 programs are almost between Windows 8/10/11, but much less the UWP type elements.
The text was updated successfully, but these errors were encountered: