繁体   English   中英

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

[英]How to group different apps in Windows task bar?

我在PC上同时运行了5个不同的C#应用​​程序。 他们在我的任务栏上占用了大量空间。 如何对它们进行编码以在任务栏上组合在一起(使用Windows 10)。

您需要pinvoke SetCurrentProcessExplicitAppUserModelID()为您要共享任务栏按钮的所有应用程序提供相同的AppID。 然后,操作系统会将您的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);

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

哦,我也刚刚在堆栈上发现了这个: 为我的应用程序控制windows 7任务栏分组

希望这可以帮助。

暂无
暂无

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

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