【发布时间】:2010-12-07 23:03:34
【问题描述】:
我开发了一个可能使用 adobe flash 的 C++ 程序,虽然它不是必需的。
我使用 CoCreateInstance 创建 flash 对象,如果失败,我知道 flash 没有安装,所以我不使用它。
但是,在 Vista 中(我也认为是 Windows 7),当未安装 flash 时,离开应用程序后,“程序兼容性助手”会弹出一条消息,指出“此程序需要缺少 Windows 组件”,指定 flash。 ocx.
有没有办法阻止此消息出现?我不想强迫任何用户安装 flash(特别是因为它是 IE ActiveX,而 FireFox 用户可能没有安装它),并且我的应用程序可以在没有 flash 的情况下正常运行。
另外,每次运行后都会出现此消息,这真的很烦人。
我当然不是说禁用用户机器上的 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>
已解决 Windows 7。
但出于某种原因,它仍然会在 Vista 32 中发生...
我还尝试编辑导致问题的特定 DLL 的清单,但没有效果。只有可执行文件的清单本身会影响问题。
所以... Vista 32?
【问题讨论】:
标签: flash winapi com windows-vista compatibility