注册的文件类型和自定义文档图标.NET自定义、文件类型、图标、文档

由网友(眼角那一咝泪)分享简介:我有一个产生的文件的应用程序。我想连接这些文件与应用程序,以便对文件双击启动我的应用程序。I have application that produces files. I would like to connect those files with application so that double-click...

我有一个产生的文件的应用程序。我想连接这些文件与应用程序,以便对文件双击启动我的应用程序。

I have application that produces files. I would like to connect those files with application so that double-click on file launches my application.

一切工作正常,除了烦恼的图标看起来同样喜欢我的应用程序的图标。我想有申请一个图标和一个图标为它的文件。

Everything works properly except for annoyance that icon looks same like icon of my application. I would like to have one icon for application and one icon for it's documents.

的DefaultIcon值要求APP.EXE,1语法,其中1是图标的索引。似乎.NET资源不Win32的资源

DefaultIcon value in registry requires "app.exe,1" syntax where 1 is icon index. It seems that .NET resources are not Win32 resources.

我试着以下,但没有成功:

I tried following but without success:

选择嵌入的资源为 文件的生成操作。 添加图标资源文件。 Selecting "Embedded Resource" as file's build action. Adding icon to resource file.

唯一的工作是具有可执行分离图标文件,并指向它。然而,在我看来,像投降。

Only thing that worked is having icon file separated from executable and pointing to it. However, that seems to me like surrender.

任何想法如何解决这个问题?

Any ideas how to solve this?

推荐答案

您是否尝试过设置2的图标指数?

Have you tried setting 2 as the icon index?

编辑: 我找到了一种方法,但你必须做一遍,每一个新版本。

I found a way but you have to do it again for every new build.

打开Visual Studio中的.exe文件(文件 - >打开文件), 右键单击该图标,文件夹,然后选择添加资源 单击该按钮导入 选择您的.ico文件 您可能要惹的图标数字,我认为最低的数字(例如101)将应用程序的图标 记住的新图标号码,并将其设置为首页

编辑2: 试试这个文章: HTTP://www.$c$cproject.com/KB /dotnet/embedmultipleiconsdotnet.aspx

EDIT 2: Try this article: http://www.codeproject.com/KB/dotnet/embedmultipleiconsdotnet.aspx

阅读全文

相关推荐

最新文章