How do I set iconNum for registerFileAssociation to use icon.ico

The docs say

iconResourceNumber: the icon that gets displayed for the file type will be found by looking up this resource number in the executable. Pass 0 here to not use an icon

How do I know the resource number? Google says I have to find the #if definition for IDI_ICON1 or IDI_ICON2 in resources.h but I can not find it.

I tried some numbers like 0, 1, 2, and 101, but neither seems to work.

Any leads? Setting up a custom Icon is ok too, but know Idea how to add “resources”

I am using custom icons on Windows for my app.

I use a custom .rc file. It has this in it:

#include <windows.h>

// apparently I need to have the app icon as the first two
// listed icons; the second one appears in the titlebar
//
// I have no idea where 'APPICON' for example is #defined, or even used
// cannot locate it, yet this shit works

APPICON                 ICON    DISCARDABLE     "APPICON.ICO"
APPICON_SM              ICON    DISCARDABLE     "APPICON.ICO"   // KJ#0156

As it says in the comments, I have no idea how/why this works, but it does.

My custom icon file is named APPICON.ICO.

In Projucer, Visual Studio 2019 Settings, in ExtraPrepocessorDefinitions, the path to the RC file:

JUCE_USER_DEFINED_RC_FILE="../../../../Assets/Windows/Icons/MyCustomRCFile.rc" 

I think that was all that was to it…

Interesting! But I think I’m missing something: I want files associated with my program with WindowsRegistry::registerFileAssociation ( JUCE: WindowsRegistry Class Reference ) to have my icon in the Windows Explorer, and it wants me to pass an iconNum.

With your example, what is the iconNum to pass?