Home » Questions » Computers [ Ask a new question ]

How windows 7 tracks association between taskbar icon and running application?

How windows 7 tracks association between taskbar icon and running application?

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?

Asked by: Guest | Views: 282
Total answers/comments: 1
Guest [Entry]

"I can't repeat the behaviour you describe on my system.
When I pin a notepad to the taskbar, then change the target of that icon to wordpad, then that particular icon is not associated anymore with notepad.
As in, when I open notepad (via start - run) it has its own new icon on the taskbar. When I open wordpad, it is still associated with the first notepad icon from which I changed the target.

So I think the mapping is done by the target of the icon. If an application is started, it gets added on the taskbar to the icon with the same target. And you can modify that target through the properties of the icon, like you describe yourself."