Windows 7 Having issue with shortcut icon and taskbar icon


My application previously works well in XP. When I run it in Windows 7, I am facing some issue with taskbar icon.

Please let me elaborate further. Let say the application executable is A.exe. A.exe can run on its own. It can accept some arguments e.g. "A.exe /B" and "A.exe /C". During the application installation, I created 3 shortcuts in Start | Programs, one launch A.exe,second launch "A.exe /B", and the last one launch "A.exe /C". Each of the shortcut has different icon to show the different options, although they are all launching A.exe. Let say the icon name are A.ico, B.ico and C.ico respectively. These 3 icons are in A.exe dll itself and I set the correct icon in InstallShield shortcut command. I also registered a file type .abc in registry, that it will have shell/open/command to launch A.exe if double click.

In XP, when I launch either of the shortcut, the taskbar icon and program icon, remain the same which is A.ico. In Windows 7, when I used shortcut to launch A.exe, it works fine, both taskbar icon and program MainForm icon are A.ico. When I used shortcut to launch "A.exe /B", the taskbar icon changed to B.ico, but the program icon shown in MainForm remains A.ico. If I double click on (which will launch A.exe and read content), the taskbar icon is B.ico instead of A.ico. This is the same when I launch "A.exe /C", the taskbar icon is now C.ico, although MainForm remains A.ico. At this point, when I double click on, as you might have guess, the icon is C.ico. If I double click on A.exe, the taskbar icon is C.ico.

I've spend effort troubleshoot to make sure A.ico is actually loaded in my program. B.ico and C.ico are used only in the shortcut. I also tried delete the icon cache but to no avail. It seems to me Windows 7 cache some application previous lunch information and reuse it on next application launch. But I found no clue to verify my thoughts.

Appreciate if anyone has any clue on this. Before I forgot, I see this issue in both Windows 7 32 and 64-bits.

Thank you.


I found a way to simplify my queries. At Windows 7, create 3 program shortcuts which execute same executable. Then change icon for second shortcut and third shortcut. When we launch the executable from the second and third shortcut, the taskbar icon of the executable will be that of the shortcut icon instead of the executable MainForm icon. Is this the intended behaviour of Windows 7?

Thank you.


New Member
Did any body face issue with creating Modeless Dialog through "CreateDialog()" of c++ for the Windows 7 64 bit machine?

This website is not affiliated, owned, or endorsed by Microsoft Corporation. It is a member of the Microsoft Partner Program.