You probably remember when Windows XP arrived with that fresh new look, and you could revert it back to Windows 95/2000 classic appearance, or you could change the color theme. That was called visual styles, which brought to Windows a better theming support.
Visual styles remained as a feature since then. Windows Vista and 7 introduced Aero, but they still allowed using the classic theme. Windows 8 has removed both Aero and the classic theme, and added the Metro theme. High-contrast themes are now part of visual styles and do not have the classic appearance anymore.
Thus, a classic themed application in Windows 7 when it was expected an Aero style, is an issue with the visual style of the application. I'm not sure why but Microsoft did not leave the old classic theme optional while migrating the API to the new look.
So, how do I apply the modern style?
Either way this MSDN article explains how to enable visual styles for your application. I have seen people saying that enabling Unicode (defining UNICODE
) would make it, but it is not required. Basically, you just need to write a manifest file specifying version 6 of the common controls DLL as requirement, then embed it as a resource or place under appname.exe.manifest
in the executable's directory. A sample manifest would look like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" processorArchitecture="*"
name="CompanyName.ProductName.YourApplication" type="win32"/>
<description>Your application description here.</description>
<dependency>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Windows.Common-Controls"
version="6.0.0.0" type="win32" processorArchitecture="*"
publicKeyToken="6595b64144ccf1df" language="*"/>
</dependentAssembly>
</dependency>
</assembly>
If you go for the embed option, don't forget to have winuser.h
included in your resource file. You may also want to initialize the common controls DLL in your WinMain
, according to this MinGW guide:
I’ve seen this step missed in some examples, and it can cause some odd behaviors under certain operating system versions and certain conditions, such as buttons being invisible, or dialogs failing to be created.
INITCOMMONCONTROLSEX icc;
icc.dwSize = sizeof(icc);
icc.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&icc);