flash – 如何以编程方式阻止Vista(和Windows 7)中的“程序兼容性助手”出现?

我开发了一个可能使用adobe flash的C程序,虽然它不是必需的.
我使用CoCreateInstance创建flash对象,如果失败,我知道没有安装flash,所以我不使用它.
但是,在Vista(我也认为是Windows 7)中,当没有安装flash时,在离开应用程序后,“程序兼容性助手”弹出一条消息,指出“此程序需要缺少Windows组件”指定闪存. OCX.
有没有办法阻止此消息出现?我不想强迫任何用户安装闪存(特别是因为它是IE ActiveX,而FireFox用户可能没有安装它),并且我的应用程序可以在没有闪存的情况下正常运行.
再加上这条消息在每次运行后出现时都非常烦人.
我当然不是要在用户的计算机上禁用PCA,而是在所有计算机上以编程方式禁用此特定外观.

有什么想法吗?
谢谢

[编辑:]

我跟随Shay的领导(谢谢),并做了一些我自己的挖掘.我将以下XML添加到应用程序的清单中:

<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
  <security>
    <requestedPrivileges>
      <requestedExecutionLevel level="asInvoker" uiAccess="false">
      </requestedExecutionLevel>
   </requestedPrivileges>
  </security>
</trustInfo>

(另见:msdn.microsoft.com/en-us/library/bb756929.aspx)
这解决了Vista 64上的问题.

为解决Windows 7上的同样问题,我添加了以下内容:

<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>

(另见:blogs.msdn.com/yvesdolc/archive/2009/09/22/the-new-compatibility-section-in-the-application-manifest.aspx)

解决了Windows 7.

但出于某种原因,它仍然发生在Vista 32 …

我也尝试编辑导致问题的特定DLL的清单,但它没有任何效果.只有可执行文件的清单本身才会影响问题.

那么…… Vista 32?

解决方法

来自 here的片段(谈论设置但与您的案例相关)

How can I opt out of the Program Compatibility Assistant for my
setup?

In order to prevent the Program Compatibility Assistant from appearing,you must include an embedded manifest that specifies a requested execution level for your setup executable. If you wrap the setup executable in a self-extracting package,you must also include an embedded manifest in the self-extracting package too. Once you do this,Windows Vista will treat your setup as Windows Vista-aware,and it will no longer show the PCA dialog when setup exits after a failure or cancellation.

相关文章

  译序:JWMediaPlayer是开源的网页使用的Flash播放器。本...
    Flash编程原理都是只能将1写为0,而不能将0写成1.所...
 上传setenvgatewayip192.168.1.1;setenvserverip192.168.1...
Error:FlashDownloadFailed-"Cortex-M3"出现一般有...
jPlayer是一个用于控制和播放mp3文件的jQuery插件。它在后台...
#ifndef__FONTUPD_H__#define__FONTUPD_H__#include"sy...