Change ApplicationID of current process with C #

In Windows 7, we have the ApplicationID concept, which allows (among other things) to group several icons in the taskbar. How can I change the ApplicationID of the current process from C #? I am trying to create a WinForm application icon group with another application. I tried using the Code Code library for the Windows API, holding the following code in the Load event ... but that didn't work. Suggestions?

TaskbarManager.Instance.ApplicationId = "MyAppID"; Process[] p = Process.GetProcessesByName("OtherProcess"); TaskbarManager.Instance.SetApplicationIdForSpecificWindow(p[0].MainWindowHandle, "MyAppID"); 
+4
source share
2 answers

I repeat this. I think the SDK documents are erroneous and the XML documents for the SetApplicationIdForSpecificWindow () method are correct:

AppId specifies a unique application User Model Identifier (AppID) for an application or a separate top-level window with a custom JumpList taskbar button created through a class of methods.

By setting appId for a specific window, the window will NOT be grouped with it by the parent window / application. Instead, he will have his own taskbar Button.

I emphasized NOT.

+2
source

A (somewhat) obvious solution is to set both identifiers of the Windows applications that you want to group together with the same identifier.

Example:

 TaskbarManager.Instance.SetApplicationIdForSpecificWindow(win1.MainWindowHandle, "W00T"); TaskbarManager.Instance.SetApplicationIdForSpecificWindow(win2.MainWindowHandle, "W00T"); 

Aaaaand both windows will be grouped together.

0
source

Source: https://habr.com/ru/post/1303264/


All Articles