XP Visual Styles的一点体会

    首先在MSDN里Using Windows XP Visual Styles对Visual Styles的使用有详细描述,特别是对我一直很迷惑的XPMan单元,有了解释。在XPMan单元里有很重要的一行,{$R WindowsXP.res}。里面用XML描述了一些信息,结合msdn

AttributeDescription
versionVersion of the manifest. The version must be in the form major.minor.revision.build (that is, n.n.n.n, where n <=65535).
processorArchitectureProcessor for which your application is developed.
nameIncludes company name, product name and application name.
typeType of your application, such as Microsoft Win32.

下面的表格是assemblyIdentity属性区(The following table shows the attributes set by the assemblyIdentity element in the manifest description section)

AttributeDescription
typeType of the dependency component, such as Win32.
nameName of the component.
versionVersion of the component.
processorArchitectureProcessor that the component is designed for.
publicKeyTokenKey token used with this component.
languageLanguage of the component.

这是MSDN的例子。

<? 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
="X86"
    name
="CompanyName.ProductName.YourApplication"
    type
="win32"
/>
< description > Your application description here. </ description >
< dependency >
    
< dependentAssembly >
        
< assemblyIdentity
            
type ="win32"
            name
="Microsoft.Windows.Common-Controls"
            version
="6.0.0.0"
            processorArchitecture
="X86"
            publicKeyToken
="6595b64144ccf1df"
            language
="*"
        
/>
    
</ dependentAssembly >
</ dependency >
</ assembly >

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

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

    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。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值