Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow changing the taskbar icon #7076

Closed
Dreamykass opened this issue Jul 25, 2020 · 12 comments
Closed

Allow changing the taskbar icon #7076

Dreamykass opened this issue Jul 25, 2020 · 12 comments
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. Resolution-Won't-Fix We're just really obstinate about this. There's probably a good reason.
Milestone

Comments

@Dreamykass
Copy link

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

@Dreamykass Dreamykass added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Jul 25, 2020
@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jul 25, 2020
@JaiganeshKumaran
Copy link

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.

@zadjii-msft
Copy link
Member

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 zadjii-msft added Area-Settings Issues related to settings and customizability, for console or terminal Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels Jul 27, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Jul 27, 2020
@zadjii-msft zadjii-msft added this to the Terminal Backlog milestone Jul 27, 2020
@JaiganeshKumaran
Copy link

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

@zadjii-msft
Copy link
Member

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

@DHowett DHowett added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jul 27, 2020
@Dreamykass
Copy link
Author

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.

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jul 28, 2020
@zadjii-msft zadjii-msft removed Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jul 31, 2020
@trippwill
Copy link
Member

trippwill commented 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

@zadjii-msft
Copy link
Member

xlink: #4768 (comment) has the most comprehensive summary of the problem space

@zadjii-msft
Copy link
Member

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 zadjii-msft added the Resolution-Won't-Fix We're just really obstinate about this. There's probably a good reason. label Aug 17, 2023
@zadjii-msft
Copy link
Member

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 zadjii-msft closed this as not planned Won't fix, can't repro, duplicate, stale Aug 17, 2023
@halifir
Copy link

halifir commented 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.

@zadjii-msft
Copy link
Member

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.

@halifir
Copy link

halifir commented 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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. Resolution-Won't-Fix We're just really obstinate about this. There's probably a good reason.
Projects
None yet
Development

No branches or pull requests

6 participants