Grouping individual processes on the Windows taskbar

I have several separate processes that are logically connected (but they all start separately - there is no common โ€œparentโ€ process).

Is it possible that they appear as a single group on the Windows taskbar?

Working sample

Here is a working code inspired by Remy that answers

using System; using System.Runtime.InteropServices; using System.Security; namespace ConsoleApplication1 { [SuppressUnmanagedCodeSecurity] internal static class SafeNativeMethods { [DllImport("shell32.dll")] public static extern int SetCurrentProcessExplicitAppUserModelID([MarshalAs(UnmanagedType.LPWStr)] string AppID); [DllImport("kernel32.dll")] public static extern bool AllocConsole(); [DllImport("kernel32.dll")] public static extern bool FreeConsole(); } internal class Program { public static int SetApplicationUserModelId(string appId) { // check for Windows 7 Version version = Environment.OSVersion.Version; if ((version.Major > 6) || (version.Major == 6 && version.Minor >= 1)) return SafeNativeMethods.SetCurrentProcessExplicitAppUserModelID(appId); return -1; } [STAThread] public static void Main(string[] args) { int result = SetApplicationUserModelId("Gardiner.Sample1"); SafeNativeMethods.AllocConsole(); // Now we have a console, we can write to it Console.Title = "Sample 1"; Console.WriteLine("Sample 1 {0}", result); Console.ReadLine(); SafeNativeMethods.FreeConsole(); } } } 

To make this work, the executable must be set to "Output Type" on "Windows Application" and configure the "Launch Object" as "ConsoleApplication1.Program" (for the code example above).

+4
source share
1 answer

Yes, but only on Windows 7 and later. Several processes and windows are grouped together on the taskbar if they have the same Application Model Identifier assigned to them.

+4
source

All Articles