首先在MSDN里Using Windows XP Visual Styles对Visual Styles的使用有详细描述,特别是对我一直很迷惑的XPMan单元,有了解释。在XPMan单元里有很重要的一行,{$R WindowsXP.res}。里面用XML描述了一些信息,结合msdn
Attribute | Description |
---|---|
version | Version of the manifest. The version must be in the form major.minor.revision.build (that is, n.n.n.n, where n <=65535). |
processorArchitecture | Processor for which your application is developed. |
name | Includes company name, product name and application name. |
type | Type of your application, such as Microsoft Win32. |
下面的表格是assemblyIdentity属性区(The following table shows the attributes set by the assemblyIdentity element in the manifest description section)
Attribute | Description |
---|---|
type | Type of the dependency component, such as Win32. |
name | Name of the component. |
version | Version of the component. |
processorArchitecture | Processor that the component is designed for. |
publicKeyToken | Key token used with this component. |
language | Language of the component. |
这是MSDN的例子。






















这是Delphi的WindowsXP.res里的xml文件



















Delphi程序里包含了WindowsXp.res,也就有了Visual Styles的风格。
Delphi还有一个包装了uxTheme.dll的类,TThemeServices。
这方面csdn上出自《 Delphi 完全时尚手册之 Visual Style 篇---使非标准 Win32 控件或自画控件也具有 Windows XP 的界面风格》http://blog.csdn.net/happyjoe/archive/2003/05/13/8542.aspx的文章有比较详细的描述。由于我也没有实际用过,只是按照上文所述例子大概实验了一下,所以不再做深入评论。
另外要注意的一小点是,XP系统必须使用Windows Xp样式,在外观里选用的。ThemeServices.ThemesEnabled 才为True。