How to turn off visual styles for a control using SetWindowTheme function on Windows 11?

Jain Zachariah 0 Reputation points
2025-04-22T18:49:32.52+00:00

With "visual styles" enabled by the host application, radio button and checkbox controls no longer send WM_CTLCOLORSTATIC messages. We rely on these messages to provide dark mode support by customizing colors. The solution was to disable visual styles for these controls based on this documentation - https://learn.microsoft.com/en-us/windows/win32/controls/cookbook-overview#turning-off-visual-styles. But this solution doesn't seem to work anymore on windows 11.

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,761 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.