为文件类型设置图标
我已使用 Qt Creator 并创建了 my.exe 文件和新扩展名“.newext”,并手动将 .newext 文件关联到 my.exe 像这样。
该exe文件的图标是正方形,名为myIcon.ico。我在 myapp.rc 文件中描述了这样的图标:
IDI_ICON1 ICON DISCARDABLE "myIcon.ico"
另外,在 .pro 文件中,我添加了这一行:
RC_FILE = myapp.rc
现在,当我在注册表中设置 .newext 扩展名时,DefaultIcon 键的值等于,
C:\path\to\my.exe,0
然后我会看到该图标的方形图标我与 my.exe 关联的文件
当我设置
C:\path\to\my.exe,1
时,无法识别图标。
为了将白皮书(包裹在右上角)和我的方形图标(稍微变小一点)视为图标,要设置什么值?
PS我知道在.exe文件中不指定新资源应该是可能的,因为当我对Vista说“始终使用my.exe打开”时,它会放置我上面描述的图标(当然不改变我的.exe) 。
I have used Qt Creator and created my.exe file and a new extension ".newext" and have manually associated .newext files to the my.exe like this.
The exe file has as its icon which is square figure and named myIcon.ico. I have described in myapp.rc file the icon like this:
IDI_ICON1 ICON DISCARDABLE "myIcon.ico"
Also in a .pro file I have added this line:
RC_FILE = myapp.rc
Now when I set for .newext extension in registry the value of DefaultIcon key equal to
C:\path\to\my.exe,0
then I see the squere icon for the file that I have associated to my.exe
When I set
C:\path\to\my.exe,1
then there is no icon recognized.
What to set for the value in order to see as an icon the white paper (wrapped at the top-right corner) and on that my square icon - a little bit made smaller?
P.S. I know that it should be possible without specifying a new resource in the .exe file because when I say to Vista "Open with my.exe always", then it puts the icon I described above (of course without changing my .exe).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道这是否可能。我还没有看到任何应用程序这样做。您需要做的是了解 Windows 如何创建这些图标并运行此机制来创建一个图标,然后将生成的图标与您的文件类型相关联。它可能位于 Windows 深处的某个地方。
我的建议是不要这样做,绘制你自己的图标。
I don't know if it is possible at all. I haven't seen any application doing that. What you would have to do is to discover how the Windows creates these icons and run this mechanism to create one, then associate generated icon to your file type. It may be somewhere deep inside the Windows.
My advise is not don't do this, draw your own icon.