简体   繁体   English

应用程序按什么信息分组在 Windows 任务栏

[英]By what information are applications grouped in Windows Taskbar

I have a WPF application that has two builds, one is beta and another is stable .我有一个 WPF 应用程序,它有两个版本,一个是beta ,另一个是stable定版。

The user can have both of them installed at the same time, each within its own folder in %localappdata% ( %localappdata%\app-name and %localappdata%\app-name (beta) .用户可以同时安装它们,每个都在%localappdata%%localappdata%\app-name%localappdata%\app-name (beta)中的自己的文件夹中。

When they are both installed at the same time, Windows groups them on the taskbar as if being the same application.当它们同时安装时,Windows 将它们分组在任务栏上,就像是同一个应用程序一样。

So, the apps are not binary-equal, they reside in different directories and they do not have the same title.因此,这些应用程序不是二进制相等的,它们位于不同的目录中并且它们没有相同的标题。 But there's obviously a piece of information that's shared between the two apps which is what Windows uses to determine how to group the apps, but I don't know what piece of information that is.但是显然有一条信息在两个应用程序之间共享,即 Windows 用来确定如何对应用程序进行分组的信息,但我不知道那是什么信息。

What is that piece of information which I need to change for one of them so that they can be properly distinguished by Windows in order for each to have its own taskbar item?我需要为其中一个更改那条信息是什么,以便可以通过 Windows正确区分它们,以便每个都有自己的任务栏项目?

The GUID in assembly info:程序集信息中的 GUID:

You should create a different GUID for each version https://learn.microsoft.com/en-us/do.net/api/system.guid.newguid?view.net-7.0您应该为每个版本创建不同的 GUID https://learn.microsoft.com/en-us/do.net/api/system.guid.newguid?view.net-7.0

在此处输入图像描述

The taskbar grouping is based on the Application User Model IDs (AppUserModelIDs) .任务栏分组基于应用程序用户 Model ID (AppUserModelIDs) If you don't specify one then Windows will generate one for you using undocumented details.如果您不指定一个,则 Windows 将使用未记录的详细信息为您生成一个。

You can p/invoke SetCurrentProcessExplicitAppUserModelID to set a specific one for the whole process.您可以 p/invoke SetCurrentProcessExplicitAppUserModelID为整个过程设置一个特定的。 It is also possible to set one per window.也可以按 window 设置一个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM