Without a hint of displaying the icon, the shell selects the one with the lowest identifier, or the first that comes in alphabetical order. There are three icons in your executable file: ICOFOLD, ICOOK, and MAINICON. ICOFOLD is the one that should be displayed in the shell folder.
The taskbar or form icon is set by sending messages WM_SETICONafter starting your program. Therefore, there is no guesswork.
source
share