Skip to content

Allow changing the taskbar icon #7076

Closed as not planned
Closed as not planned

Description

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

Activity

  1. added
    Issue-Feature
    on Jul 25, 2020
  2. ghost added
    Needs-Tag-Fix
    on Jul 25, 2020
  3. ghost added
    Needs-Triage
    on Jul 25, 2020
  4. jgkumaran commented on Jul 26, 2020

    @jgkumaran

    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.

  5. zadjii-msft commented on Jul 27, 2020

    @zadjii-msft
    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.

  6. added
    Area-Settings
    Help Wanted
    Issue-Task
    Product-Terminal
    and removed
    Issue-Feature
    on Jul 27, 2020
  7. ghost removed
    Needs-Tag-Fix
    on Jul 27, 2020
  8. jgkumaran commented on Jul 27, 2020

    @jgkumaran

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

  9. zadjii-msft commented on Jul 27, 2020

    @zadjii-msft
    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

  10. added
    Needs-Author-Feedback
    on Jul 27, 2020
  11. 1 remaining item

  12. ghost added
    Needs-Attention
    on Jul 28, 2020
  13. ghost removed
    Needs-Author-Feedback
    on Jul 28, 2020
  14. removed
    Needs-Attention
    Needs-Triage
    on Jul 31, 2020
  15. zadjii-msft commented on Apr 28, 2023

    @zadjii-msft
    Member

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

  16. zadjii-msft commented on Aug 16, 2023

    @zadjii-msft
    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.

  17. added
    Resolution-Won't-Fix
    on Aug 17, 2023
  18. zadjii-msft commented on Aug 17, 2023

    @zadjii-msft
    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.

  19. halifir commented on May 7, 2024

    @halifir

    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.

  20. zadjii-msft commented on May 7, 2024

    @zadjii-msft
    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.

  21. halifir commented on May 7, 2024

    @halifir

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-SettingsHelp WantedIssue-TaskProduct-TerminalResolution-Won't-Fix

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions