如何使用嵌入的清单作为资源? (Windows XP/Vista 风格的控件)
我有一个作为 Windows 资源嵌入的清单。但正确的应用方法是什么?
更具体地说:
我有我的 .manifest 文件。这是使应用程序使用 Windows XP/Vista 视觉样式中的控件的标准方法。当通过与 .exe 位于同一目录并适当命名来应用时,它可以工作。
然而,这种方法相当麻烦。我希望我的 .exe 是独立的。显然这是可以做到的,因为我的计算机上的许多应用程序都设法使用现代风格,而无需单独的清单文件。
所以我环顾四周,终于发现将清单作为资源嵌入。所以我已将这一行添加到我的 .rc 文件中:
1 RT_MANIFEST "mdiedit.exe.manifest"
但是接下来我该怎么办?
编辑:如果对您有帮助的话,我的程序是用 D 编写的,并使用 Digital Mars D 和资源编译器构建。没有IDE。但我希望任何适用于 C(++) 的解决方案在使用命令行工具构建时也适用于 D。
I have a manifest embedded as a Windows resource. But what's the right way to apply it?
More specifically:
I have my .manifest file. It's the standard one to make an app use controls in the Windows XP/Vista visual style. When applied by being in the same directory as the .exe and suitably named, it works.
However, this approach is rather cumbersome. I'd like my .exe to be self-contained. Clearly it can be done, given that many of the apps on my computer manage to use the modern style without a separate manifest file.
So I had a look around, and finally found embedding the manifest as a resource. So I've added this line to my .rc file:
1 RT_MANIFEST "mdiedit.exe.manifest"
But what do I do next?
Edit: If it helps you to know, my program is written in D and built using the Digital Mars D and resource compilers. No IDE. But I'd expect any solution that works in C(++), when built using command-line tools, to work in D as well.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
RT_MANIFEST
是一个定义,因此请确保您的资源文件包含正确的标头,或者只需将RT_MANIFEST
替换为 24RT_MANIFEST
is a define, so make sure your resource file includes the correct header, or just replaceRT_MANIFEST
with 24您是否已将 .rc 文件添加到您的项目中?或者,使用开发环境的资源编译器(例如 brcc32.exe 或 rc.exe)将 .rc 文件编译为 .res 文件,然后将该文件添加到项目中。
Did you add the .rc file to your project yet? Alternatively, use your development environment's resource compiler, such as brcc32.exe or rc.exe, to compile the .rc file into a .res file, and then add that file to your project.