Allow changing the taskbar icon #9856

Closed
opened 2026-01-31 02:05:38 +00:00 by claunia · 12 comments
Owner

Originally created by @Dreamykass on GitHub (Jul 25, 2020).

Description of the new feature/enhancement

Allow changing the taskbar icon, for a bit more additional and nice customization.

Proposed technical implementation details

A parameter in settings.json? Allowing either picking any icon, or just providing a toggle to use the monochrome icon that's used in high-contrast mode.

Why?

I got Windows Terminal from chocolatey, which gets it from Microsoft Store, so it's not possible to just right-click, go to properties, and select a different icon, like with other apps.

How my taskbar looks currently:
image

How I'd really love it to look like:
image

Originally created by @Dreamykass on GitHub (Jul 25, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement Allow changing the taskbar icon, for a bit more additional and nice customization. <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> # Proposed technical implementation details A parameter in settings.json? Allowing either picking *any* icon, or just providing a toggle to use the monochrome icon that's used in high-contrast mode. # Why? I got Windows Terminal from chocolatey, which gets it from Microsoft Store, so it's not possible to just right-click, go to properties, and select a different icon, like with other apps. How my taskbar looks currently: ![image](https://i.imgur.com/hLlH7xl.png) How I'd really love it to look like: ![image](https://i.imgur.com/evBoCYe.png)
Author
Owner

@jaigak commented on GitHub (Jul 26, 2020):

It's not possible to change the taskbar icon in UWP apps. They always use the icon specified in their package manifest including desktop bridge apps.

@jaigak commented on GitHub (Jul 26, 2020): It's not possible to change the taskbar icon in UWP apps. They always use the icon specified in their package manifest including desktop bridge apps.
Author
Owner

@zadjii-msft commented on GitHub (Jul 27, 2020):

Okay well, this is technically different than "Display current tab's icon as a badge on the taskbar icon #1871" and "Display current tab's icon as the taskbar icon #6556". Those threads both cover more of the technical aspects of why this may or may not be possible.

I suppose I'm open to the idea of allowing the user to customize the icon, though I'd love to see how it works in practice.

@zadjii-msft commented on GitHub (Jul 27, 2020): Okay well, this is technically different than "Display current tab's icon as a badge on the taskbar icon #1871" and "Display current tab's icon as the taskbar icon #6556". Those threads both cover more of the technical aspects of why this may or may not be possible. I suppose I'm open to the idea of allowing the user to customize the icon, though I'd love to see _how_ it works in practice.
Author
Owner

@jaigak commented on GitHub (Jul 27, 2020):

@zadjii-msft Badges are possible but replacing the icon with something else can't be done in a packaged app.

@jaigak commented on GitHub (Jul 27, 2020): @zadjii-msft Badges are possible but replacing the icon with something else can't be done in a packaged app.
Author
Owner

@zadjii-msft commented on GitHub (Jul 27, 2020):

can't be done in a packaged app.

Do we have some source on that? I'd love to update the other threads with the relevant info, and file a dependency on the platform to get that restriction relaxed

@zadjii-msft commented on GitHub (Jul 27, 2020): > can't be done in a packaged app. Do we have some source on that? I'd love to update the other threads with the relevant info, and file a dependency on the platform to get that restriction relaxed
Author
Owner

@Dreamykass commented on GitHub (Jul 28, 2020):

If "Author" in "Needs-Author-Feedback" means me, then I'm afraid I don't really have much to add, as I'm not really knowledgeable in the app-making field. I just wanted to suggest that cause I love Windows Terminal, Windows itself, and the people working on these; and I think it'd be very nice if that tiny bit of customization was possible.

I made this issue/feature/suggestion cause I couldn't find (when searching on the internet) a way to do this. The usually stated reason was that it can't be done for a Microsoft Store app. For most other apps on my taskbar all that's needed is just right-clicking on the icon on the taskbar, going to properties, and changing the icon of the shortcut. Doesn't work for WT - there isn't even a "properties" option.

@Dreamykass commented on GitHub (Jul 28, 2020): If "Author" in "Needs-Author-Feedback" means me, then I'm afraid I don't really have much to add, as I'm not really knowledgeable in the app-making field. I just wanted to suggest that cause I love Windows Terminal, Windows itself, and the people working on these; and I think it'd be very nice if that tiny bit of customization was possible. I made this issue/feature/suggestion cause I couldn't find (when searching on the internet) a way to do this. The usually stated reason was that it can't be done for a Microsoft Store app. For most other apps on my taskbar all that's needed is just right-clicking on the icon on the taskbar, going to properties, and changing the icon of the shortcut. Doesn't work for WT - there isn't even a "properties" option.
Author
Owner

@trippwill commented on GitHub (Oct 3, 2020):

@Dreamykass , take a look at this for creating shortcuts to store apps: https://lifehacker.com/how-to-create-a-shortcut-for-any-modern-windows-app-1722569853

@trippwill commented on GitHub (Oct 3, 2020): @Dreamykass , take a look at this for creating shortcuts to store apps: https://lifehacker.com/how-to-create-a-shortcut-for-any-modern-windows-app-1722569853
Author
Owner

@zadjii-msft commented on GitHub (Apr 28, 2023):

xlink: https://github.com/microsoft/terminal/issues/4768#issuecomment-1527800607 has the most comprehensive summary of the problem space

@zadjii-msft commented on GitHub (Apr 28, 2023): xlink: https://github.com/microsoft/terminal/issues/4768#issuecomment-1527800607 has the most comprehensive summary of the problem space
Author
Owner

@zadjii-msft commented on GitHub (Aug 16, 2023):

Played with this more today. dev/migrie/f/4768-taskbar-icons has notes.

I concur - I don't think this'll be possible in a packaged application. We might be able to still enable this for unpackaged installs... but then you're already unpackaged where it's easier to set the icon.

I've got a line out to some taskbar folks for confirmation, but I'm not optimistic.

@zadjii-msft commented on GitHub (Aug 16, 2023): Played with this more today. `dev/migrie/f/4768-taskbar-icons` has notes. I concur - I don't think this'll be possible in a packaged application. We _might_ be able to still enable this for unpackaged installs... but then you're already unpackaged where it's easier to set the icon. I've got a line out to some taskbar folks for confirmation, but I'm not optimistic.
Author
Owner

@zadjii-msft commented on GitHub (Aug 17, 2023):

Talked this over with some taskbar folks. Looks like this is going to be largely impossible. The Taskbar really doesn't expect an app to be changing its icon at runtime. There are technically tricks we could play (by doing Aumid/RelaunchIcon trickery), but that would essentially cause the Taskbar to think the Terminal was a different app each time. Our window would get moved to the end of the taskbar order. Pinning to the taskbar would also be weird. I'm sure there are more edge cases here that they didn't just rattle off the top of their head too.

Sorry about this 😕 The aforementioned "create a shortcut to an app" does seem like the best way to get around this.

@zadjii-msft commented on GitHub (Aug 17, 2023): Talked this over with some taskbar folks. Looks like this is going to be largely impossible. The Taskbar _really_ doesn't expect an app to be changing its icon at runtime. There are technically tricks we could play (by doing Aumid/RelaunchIcon trickery), but that would essentially cause the Taskbar to think the Terminal was a different app each time. Our window would get moved to the end of the taskbar order. Pinning to the taskbar would also be weird. I'm sure there are more edge cases here that they didn't just rattle off the top of their head too. Sorry about this 😕 The aforementioned "create a shortcut to an app" does seem like the best way to get around this.
Author
Owner

@halifir commented on GitHub (May 7, 2024):

An app (eg conhost console app) can set the icon on the taskbar

icon = LoadIcon(GetModuleHandle(NULL), "IDI_ICON1"); // eg get own icon
if (icon) {
SetClassLongPtr(GetConsoleWindow(), GCLP_HICON, (LONG_PTR)icon);
SetClassLongPtr(GetConsoleWindow(), GCLP_HICONSM, (LONG_PTR)icon);
}

this works at least with windows 2000 (GetConsoleWindow() is a new function in windows 2000) up to windows 11. The windows taskbar can handle an icon change.

@halifir commented on GitHub (May 7, 2024): An app (eg conhost console app) can set the icon on the taskbar icon = LoadIcon(GetModuleHandle(NULL), "IDI_ICON1"); // eg get own icon if (icon) { SetClassLongPtr(GetConsoleWindow(), GCLP_HICON, (LONG_PTR)icon); SetClassLongPtr(GetConsoleWindow(), GCLP_HICONSM, (LONG_PTR)icon); } this works at least with windows 2000 (GetConsoleWindow() is a new function in windows 2000) up to windows 11. The windows taskbar can handle an icon change.
Author
Owner

@zadjii-msft commented on GitHub (May 7, 2024):

Sure, that's correct. However, (I'm told) packaged applications are treated differently by the taskbar. For packaged apps, the taskbar apparently ignores the HWND icon and just uses the package's icon.

Prototype code I wrote in dev/migrie/f/4768-taskbar-icons could set the icon on the window, but not the taskbar itself. I suppose I was using

        SendMessageW(_hwnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
        SendMessageW(_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);

instead of SetClassLongPtr, but I don't think that'll change the behavior here.

@zadjii-msft commented on GitHub (May 7, 2024): Sure, that's correct. However, (I'm told) packaged applications are treated differently by the taskbar. For packaged apps, the taskbar apparently ignores the HWND icon and just uses the package's icon. Prototype code I wrote in [`dev/migrie/f/4768-taskbar-icons`](https://github.com/microsoft/terminal/compare/dev/migrie/f/4768-taskbar-icons) could set the icon on the window, but not the taskbar itself. I suppose I was using ```c++ SendMessageW(_hwnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon); SendMessageW(_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)hIcon); ``` instead of `SetClassLongPtr`, but I don't think that'll change the behavior here.
Author
Owner

@halifir commented on GitHub (May 7, 2024):

I read, the the taskbar ist not able to handle Icon changes, but the "taskbar" is /or was able to do it.

The SendMessage(..., WM_SETICON, ) method worked in my apps up to Windows 7, but not Windows 10 anymore. So I added the
SetClassLongPtr methods and use SetConsoleIcon() + SendMessage() + SetClassLongPtr ().

@halifir commented on GitHub (May 7, 2024): I read, the the taskbar ist not able to handle Icon changes, but the "taskbar" is /or was able to do it. The SendMessage(..., WM_SETICON, ) method worked in my apps up to Windows 7, but not Windows 10 anymore. So I added the SetClassLongPtr methods and use SetConsoleIcon() + SendMessage() + SetClassLongPtr ().
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#9856