In windows 7, if i 'pin' application to taskbar and start it, application window will be associated with taskbar icon (icon will glow, clicking on icon will focus application window etc). As a programmer, i ave full access to application taskbar icon via API - i can make funny effects on download, manipulate context menu etc. But how windows tracks what application icon is associated with? Icon in taskbar is a .link file in a hidden folder, can be checked by shift+right click and selecting 'copy as path'. And if i shift+right click icon in taskbar, select 'properties' and change 'Target', clicking on such modified icon will lauch application i has specified as 'Target'. BUT - such application will have separate taskbar icon! And if, for example, i pin 'notepad', change 'Target' to 'wordpad' and start notepad via 'run', modified icon will be still associated with noteap! And wordpad will start having separate taskbar icon. Where windows keep such associations? Is it possible to modify them?
It seems that i set a wrong experiment. The problem is only with non-exe files (.bat, .py etc), changing target to executable will effectively re-associate it with icon O_O.