Adding a Windows 7 Application Manifest to your application

 

转自:http://blogs.msdn.com/ukisvdev/archive/2009/09/23/adding-a-windows-7-application-manifest-to-your-application.aspx

 

One of the most important things you can do to make an application compatible with Windows 7 is to add an application manifest to it. When you do this, you are telling Windows that you have tested your application on Windows 7 and that there is no need for it to run application compatibility ‘features’ such as UAC virtualization and the Program Compatibility Assistant.

There are a number of ways to add a manifest, you can do it from within Visual Studio 2008 by simply selecting Add -> New Item… to the project, and selecting Application Manifest File, and for earlier versions of Visual Studio you can simply add it as a resource of type RT_MANIFEST, or you can use the mt.exe tool in the Windows SDK to add it to the compiled executable – before you have signed it of course.

If you are using the mt.exe tool it’s best to extract any existing manifest first, as one may already be included for XP Styles or Side-by-Side COM components.

You can extract an application manifest from an executable by running the following command: mt -inputresource:myapp.exe;#1 -out:myapp.manifest

You can then add the Windows 7 manifest shown below back into the executable using the following command:  mt -manifest myapp.manifest -outputresource:myapp.exe;#1

<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance%22>
  <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
    <security>
      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
        <requestedExecutionLevel level="asInvoker" uiAccess="false" />
      </requestedPrivileges>
    </security>
  </trustInfo>
  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
    <application>
      <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
    </application>
  </compatibility>
</asmv1:assembly>

转载于:https://www.cnblogs.com/jianfeng/archive/2009/12/14/1623611.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值