从c#更改正在运行的进程的ApplicationID


Windows 7中,我们有ApplicationID的概念,它允许(除其他外)在任务栏中分组几个图标.

如何从c#更改正在运行的进程的ApplicationID?我正在尝试用另一个应用程序制作我的WinForm应用程序的图标组.

我尝试过使用Windows API Code Pack Library,在我的Load事件中粘贴以下代码……但它不起作用.建议?

TaskbarManager.Instance.ApplicationId = "MyAppID";    
Process[] p = Process.GetProcessesByName("OtherProcess");
TaskbarManager.Instance.SetApplicationIdForSpecificWindow(p[0].MainWindowHandle, "MyAppID");

最佳答案 我责备这个.我认为SDK文档是错误的,并且SetApplicationIdForSpecificWindow()方法的XML文档是正确的:

AppId specifies a unique Application
User Model ID (AppID) for the
application or individual top-level
window whose taskbar button will hold
the custom JumpList built through the
methods class.

By setting an appId for a specific
window, the window will NOT be grouped
with it’s parent window/application.
Instead it will have it’s own taskbar
button.

我强调不.

点赞