Change icon of group in taskbar (Win7)

前端 未结 2 753
别那么骄傲
别那么骄傲 2021-01-22 07:09

Using LoadImage I changed the icon of all the windows in a group. However the group icon does not change. How can I get the corresponding group to a window and set

相关标签:
2条回答
  • 2021-01-22 07:51

    Your issue is this: The icon does infact take the icon of the first WINDOW, not exe. HOWEVER, after setting the icons, you have to right click on the icon in the taskbar, then pin it, then unpin it. On unpin the taskbar icon now takes the first windows icon.

    I don't know how to programatically do this to maybe @RemyLebeau knows. Maybe setClassLongPtr? Not sure.

    Now when it's pinned you want to make it use the same icon, so set the registry value like @RemyLebeau suggested.

    Also I don't know how to explain this, but after unpinning, and the icon takes, if you open the jump list, the icon reverts back to the exe's icon. This may be fixed with the registry setting for pinned icon, I'm not sure.

    Wow so Win7 taskbar is so tweakish.

    Edit: I tried setting my registry values and the icon didnt work. It might have to do something with: the registry entires that i found for TaskbarGroupIcon all had a data value ending with a comma and a number (ex: ,-4 in %SystemRoot%\System32\imageres.dll,-4)

    0 讨论(0)
  • 2021-01-22 08:00

    The group icon comes from the EXE file itself (in the case of multiple EXEs contributing to the same group, I imagine the taskbar has some algorithm to decide which EXE to pull the icon from). There is no official API to change the group icon. You would have to manipulate the Taskbar directly, which is not impossible but not trivial either.

    Update: I just came across the following answer, maybe it will help you:

    https://stackoverflow.com/a/219128/65863

    Update: Apparently the Registry value in the above link only applies if the app is pinned to the Taskbar.

    0 讨论(0)
提交回复
热议问题