Common Controls and XP Themes

From RAD Studio
Jump to: navigation, search

Go Up to Developing the Application User Interface Index

Microsoft has forked Windows common controls into two separate versions. Version 5 is available on all Windows versions from Windows 95 or later; it displays controls using a "3D chiseled" look. Version 6 became available with Windows XP. Under version 6, controls are rendered by a theme engine which matches the current Windows XP theme. If the user changes the theme, version 6 common controls will match the new theme automatically. You do not need to recompile the application.

The VCL can now accommodate both types of common controls. Embarcadero has added a number of components to the VCL to handle common control issues automatically and transparently. These components will be present in any VCL application you build. By default, any VCL applications will display version 6 common controls. To display version 5 controls, you (or the users of your application) must add a manifest file to your application.

A manifest file contains an XML list of dependencies for your application. For example, this is the manifest file that contains the default values provided automatically by RAD Studio.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
 <dependency>
   <dependentAssembly>
     <assemblyIdentity
       type="win32"
       name="Microsoft.Windows.Common-Controls"
       version="6.0.0.0"
       publicKeyToken="6595b64144ccf1df"
       language="*"
       processorArchitecture="*"/>
   </dependentAssembly>
 </dependency>
 <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
   <security>
     <requestedPrivileges>
       <requestedExecutionLevel
         level="asInvoker"
         uiAccess="false"/>
       </requestedPrivileges>
   </security>
 </trustInfo>
</assembly>

See Manifest File for more information and examples of how to create a custom application manifest.

For more information on Windows XP common controls, themes, and manifest files, consult Microsoft online documentation.

Note: Windows Vista, Windows XP or earlier is no longer supported.

See Also