首先在你的工程的 "res目录" 下建一个文件, 命名 windows.manifest 后缀为:.manifest
然后用记事本打开放入
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
name="Microsoft.Windows.XXXX"
processorArchitecture="x86"
version="5.1.0.0"
type="win32"/>
<description>Windows Shell</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="x86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
保存..
然后导入资源,把文件windows.manifest添加到工程的资源中:
插入->资源->引入->文件类型改为“所有文件"->找到windows.manifest->弹出对话框
资源类型 填"24"(这个好像只能填24,我也不知道什么意思,有明白的可以留言告诉我,谢谢!)->确定后再把资源的ID改为"IDR_MANIFEST"
然后在String Table中添加IDR_MANIFEST,id值为1(也可以到到resource.h中更改IDR_MANIFEST的ID值为1)。
重新生成编译运行,这样你的程序就有了XP/Win7的风格
注:本文的内容也是在网上学习的,有懂这个原理的可以教教我...