如何在 Windows 任务栏中对不同的应用程序进行分组?

How to group different apps in Windows task bar?

我的 PC 上同时有 5 个不同的 C# 应用程序 运行。他们在我的任务栏上占用了很多 space。我怎样才能将它们编码为在任务栏中组合在一起(使用 windows 10)。

我还没有尝试过这个,但你可能想看看 TaskbarItemInfo Class. I think the property ThumbButtonInfos 可能是关键。

哦,我也是刚刚在 stack over flow 上发现的: control windows 7 taskbar grouping for my application

希望对您有所帮助。

您需要调用 SetCurrentProcessExplicitAppUserModelID() 为要共享任务栏按钮的所有应用程序提供相同的 AppID。 OS 然后会将您的 5 个应用程序视为同一个应用程序。

确保在您的任何应用程序 UI 显示之前调用 SetCurrentProcessExplicitAppUserModelID()

[DllImport("shell32.dll", SetLastError=true)]
static extern void SetCurrentProcessExplicitAppUserModelID( 
    [MarshalAs( UnmanagedType.LPWStr )] string AppID );

private static string AppID = "some guid"; // use the same ID in all 5 apps

...

SetCurrentProcessExplicitAppUserModelID(AppID);