You need to embed the manifest file in an executable file that tells Windows that you want the version of the controls to include themes ( there is MSDN documentation specifically for this theme ). This is really for compatibility reasons, because some people really like to write programs that mess with the internal data structures of other programs .
In Visual C ++, perhaps the easiest way to do this is through #pragma :
#pragma comment(linker,"/manifestdependency:\"" \ "type='win32' " \ "name='Microsoft.Windows.Common-Controls' " \ "version='6.0.0.0' " \ "processorArchitecture='*' " \ "publicKeyToken='6595b64144ccf1df' " \ "language='*'\"")
This causes the linker to add something like this to the generated manifest file:
<dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*" /> </dependentAssembly> </dependency>
You also need to call InitCommonControlsEx() to register the appropriate management classes, or the dialog box does not appear.
As Mark Ransom pointed out in the comments below, Windows 2000 ignores manifests , so this should work on Windows 2000, Windows XP and later. In addition, some frameworks, such as MFC, define #pragma and do initialization for you.
source share