views:

200

answers:

1

In Windows 7 we have the concept of ApplicationID, which allows (among other things) to group several icons in the task bar. How can I change the ApplicationID of a running process from c#? I'm trying to make my WinForm app's icon group with another application. I've tried using Windows API Code Pack Library, sticking the following code in my Load event... but it didn't work. Suggestions?

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

I repro this. I think the SDK docs are wrong and the XML docs for the SetApplicationIdForSpecificWindow() method are correct:

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.

I emphasized NOT.

Hans Passant
so in your opinion there is no way to do this?
Nestor