Professional User Interface Suite, Copyright FOSS Software Inc. Help Published with Permission.

To apply an XP visual style to the common controls in your application, use ComCtl32.dll version 6 or later. Unlike earlier versions of ComCtl32.dll, version 6 is not redistributable. The only way you can use version 6 of the dynamic-link library (DLL) is to use an operating system that contains it. Windows XP ships with both version 5 and version 6. ComCtl32.dll version 6 contains both the user controls and the common controls. By default, applications use the user controls defined in User32.dll and the common controls defined in ComCtl32.dll version 5.

So, to use visual styles in your application, you must add an application manifest that indicates that ComCtl32.dll version 6 should be used if it is available.

Below is an XML content of the manifest file:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
   <assemblyIdentity 
    processorArchitecture="x86" 
    version="5.1.0.0"
    type="win32"
    name="APPLICATION_NAME"
    />
   <description>APPLICATION_DESCRIPTION</description>
   <dependency>
    <dependentAssembly>
       <assemblyIdentity
        type="win32"
        name="Microsoft.Windows.Common-Controls"
        version="6.0.0.0"
        publicKeyToken="6595b64144ccf1df"
        language="*"
        processorArchitecture="x86"
        />
    </dependentAssembly>
   </dependency>
</assembly>

Replace APPLICATION_NAME with the name of your application and APPLICATION_DESCRIPTION with a brief description.

There are two ways to add the manifest file to your application.

1. Place the XML manifest file in the same directory as your application's executable file. The manifest should be named YourApp.exe.manifest, where YourApp.exe is a name of the application executable file.

2. Embed the manifest into the application resources.

a) First, add the following line to the resource.h file. Just copy and paste the following:

   #define IDR_MANIFEST 1

Don't forget to save the file.

b) In the Resource View window, right click on the resource tree and choose import, select the manifest file you have just created and press OK to close the dialog.

c) When the Custom Resource Type dialog opens, enter 24 and press OK.

d) Rename the newly imported resource under "24" to IDR_MANIFEST.

e) Rebuild the application.

Please note that you should also initialize the common controls in your application. To do that, call the InitCommonControls() method at the beginning of the application InitInstance() method