避免c++程序在windows7或vista下关闭后出现程序兼容性助手

在windows7下面编写C++程序,每次关闭程序时都会出现程序兼容性助手的提示,如下图:

处理办法:在C++程序的文件夹里搜索到后缀名为manifest的文件,用VS或记事本打开。

复制代码
View Code
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!--The ID below indicates application support for Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!--The ID below indicates application support for Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
</application>
</compatibility>
</assembly>
复制代码

 将对应的 <compatibility> 节点复制到你的menifest文件assembly节内

找到MT.EXE路径,我的是C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64\mt.exe

将要修改的exe文件和编辑好的manifest文件放到同一目录中(我将这两个文件都放到MT.EXE所在的目录下了),执行以下命令:

进入到MT目录:

cd C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64

修改应用程序:

mt.exe /manifest Setup.exe.manifest /outputresource:Setup.exe;1

参考资料:

MSDN里MT.EXE:

http://msdn.microsoft.com/zh-cn/library/ms235591(v=VS.100).aspx

让程序不触发Vista/Win7下应用程序兼容性助手弹出:

http://blog.csdn.net/maxuhuiabc/article/details/6081874

Vista和windows7系统下程序兼容性助手:

http://developer.51cto.com/art/200810/91713.htm

posted on   ZhYong  阅读(1617)  评论(0编辑  收藏  举报

编辑推荐:
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
阅读排行:
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
< 2011年8月 >
31 1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31 1 2 3
4 5 6 7 8 9 10

统计

点击右上角即可分享
微信分享提示