【问题标题】:How to group different apps in Windows task bar?如何在 Windows 任务栏中对不同的应用程序进行分组?
【发布时间】:2016-01-20 13:16:50
【问题描述】:

我的 PC 上同时运行 5 个不同的 C# 应用程序。它们在我的任务栏上占用了很多空间。我如何将它们编码为在任务栏上组合在一起(使用 Windows 10)。

【问题讨论】:

  • 你为什么在 SO 而不是超级用户中问这个?这不是编程问题。
  • 很明显您没有阅读整个问题文本...
  • 我做到了。这是由操作系统完成的,它不是应用程序或窗口样式。它由任务栏属性中的“任务栏按钮”行为控制。即使您选择“始终合并”,也只有相同应用程序的实例才会出现平铺效果。如果您询问例如 Jumplists,那将是另一回事

标签: c# windows grouping taskbar


【解决方案1】:

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

确保调用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);

【讨论】:

    【解决方案2】:

    我没有尝试过这个,但你可能想看看 TaskbarItemInfo Class。我认为ThumbButtonInfos的属性可能是关键。

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

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-08-01
      • 1970-01-01
      • 2013-01-26
      • 2012-04-09
      • 1970-01-01
      • 2011-01-10
      • 2014-12-12
      相关资源
      最近更新 更多