The icon is the icon of the window associated with the taskbar button. So, with Application.MainFormOnTaskbar set to True, this is the icon of the main form. When False is the icon of a hidden application window. To have a different taskbar icon from the main form, you need MainFormOnTaskbar to be False and assign a different Application.Icon icon. This seems to be an easy way around this problem.
If I remember, VCL only sets one icon size. In my experience, itβs best to do the job correctly and send WM_SETICON messages directly to set both small and large icons.
As for where your icons are, link them to your executable as resources. I avoid image lists because I lose control of unprocessed .ico files, but maybe only I am picky. Feel free to use image lists if you want.
source share