更加详细的解释:http://blog.csdn.net/penglijiang/article/details/7178594 点击打开链接
1、如果编译器默认没有生成 appname exe.manifest, 那么按如下操作:
(1)
(3)在生成exe文件的目录生成*.exe.manifest文件,打开插入如下内容:
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!--This Id value indicates the application supports Windows Vista functionality -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!--This Id value indicates the application supports Windows 7 functionality-->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!--This Id value indicates the application supports Windows 8 functionality-->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!--This Id value indicates the application supports Windows 8.1 functionality-->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
</application>
</compatibility>
保存之后,将这个文件放到其他目录,比如Resource目录,
(4)在.rc文件中添加如下添加:
IDR_RT_MANIFEST 24 DISCARDABLE "Resources\\appname
.exe.manifest"
(5)在resource.h中添加资源定义
#define
IDR_RT_MANIFEST 1
(6)嵌入清单:
(6)嵌入清单:
到这里就完成了: