There is a project on c # (WPF). In addition to the main application shortcut icon, you must add the ability to select from among those presented. I understand that the icon can be downloaded separately from another file, but I would like to somehow implement it from the main EXE file.

    1 answer 1

    Unfortunately, WPF does not allow attaching a few icons out of the box. But you can easily download the icons by specifying your own res-file.

    The res-file with Win32-Resource itself will have to be compiled manually, once, with the help of rc.exe from the Windows SDK.

    You will have something like this in the rc file:

    1 ICON "mainicon.ico" 2 ICON "alternative1.ico" 3 ICON "alternative2.ico" 1 24 "app.manifest" 

    (save the file as plain ASCII).

    rc /r your_resource_file.rc this ( rc /r your_resource_file.rc ), you will receive a res-file that can be connected to the project through the project properties (Application → Resources → Resource file).


    (This answer is an adaptation of the response with en.SO. )

    • res file created, upon transition (Application → Resources → Resource file) a resx file is created. When a res file is added to it, the icons do not appear. - Dmitry Chistik
    • one
      I will add the answer. In the properties of the project in the "Application" in the "Resources" section we specify the RadioButton "Resource File" and select the file created earlier res. - Dmitry Chistik