Note that there are some explanatory texts on larger screens.

plurals
  1. POEmbed multiple icons in WPF EXE
    primarykey
    data
    text
    <p>I have a WPF assembly in which I would like to embed five icons for different filetypes associated with my application. How can I embed these icons into my EXE?</p> <p>@smoore @Groky @ChrisF, thank you. Unfortunately, this is not what I asked. I see that my question was quite vague 0_­°. Let me rephrase the question:</p> <hr> <p>I have icons, say <code>Application.ico</code>, <code>Document.ico</code>, etc. as resources in my WPF projects. I access these icons in most cases with the following:</p> <pre><code>&lt;Image Source="/MyAssembly;component/Resources/Icons/Application.ico" /&gt; </code></pre> <p>That works every single time. I know that.</p> <hr> <p>What my question is about is how can I use the same icons from Windows Explorer for file associations in the registry. I want to be able to access the icons with a path like:</p> <pre><code>C:\Program Files\MyApp\MyApp.exe,1 </code></pre> <p>Like in how icons are associated with filetypes in <code>HKEY_CLASSES_ROOT</code>.</p> <p>AFAIK, I should use a resource file (<code>.rc</code>), compile and merge it with my EXE. Something along the lines of:</p> <pre><code>101 RT_ICON Application.ico 102 RT_ICON Document.ico // etc... </code></pre> <p>Is this the right way in WPF? Is there an alternative, especially since this method seems to lead to the erasure of the assembly version from my <code>AssemblyInfo.cs</code>. I am still prepared to have to write the versioning info in the resource instead of the assembly's info.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload