Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi guys!

How can the location of an executable modify its grouping icon in the Windows 7 taskbar?

One of my apps is setting its main window icon to show some application status.
Recently I was informed that this doesn't work in Windows 7 anymore - whenever taskbar grouping is enabled, the executable's embedded icon is shown in the taskbar, regardless what the main window's icon is.

While trying to find out the reason I copied the whole application directory from C:\Program Files (x86)\... to C:\Temp and started the application from there.
With this copy the grouping icon was the same as the main window icon, so it worked like it should have done all the time.

So how on earth can the location of the executable influence it's behaviour?

A few additional pieces of information: Win7 Prof x64, UAC set to default, application is being built with target platform x86.
Taskbar icon behaves correctly when grouping is disabled.

I've even tried sacrificing a small mammal over the keyboard, but to no avail X|

If anyone can shed some light on this behaviour I'd be glad to hear from you!

Thanks,
mav

Update: The executable's path doesn't seem to be the culprit. When I create a copy of the executable (with a different name but in the same directory) and run this copy, behaviour is back to normal! WTF???

Another update: The behaviour has nothing to do with the executable in question. I could verify on 2 machines that the ability to change the icon in the superbar depends on whether a shortcut exists on the desktop or in the start menu pointing to the executable!
When there's no shortcut pointing to the executable, everything is fine.
As soon as I create a shortcut in the same directory as the executable, changing the icon works when the exe is started directly but does not work when the shortcut is used to start the executable.
When the shortcut is moved to the desktop, switching icons doesn't work anymore, even when starting the executable itself and not the shortcut!

Oh boy!

How is anyone supposed to expect this?
Posted
Updated 8-Mar-11 22:02pm
v4
Comments
Dalek Dave 3-Mar-11 4:21am    
Edited for Readability.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900