VB.NET WinForms version... (I hope I got the declare correct!)
Public Class frm1EXE2Group
'Reference: blogs.msdn.com/.../10341464.aspx
Declare Function SetCurrentProcessExplicitAppUserModelID Lib "Shell32.dll" (AppID As String) As Integer
Private mstrAppID As String
Public Sub New()
' This call is required by the designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
'AppID controls taskbar grouping. It is in the form CompanyName.ProductName.SubProduct.VersionInformation where SubProduct and VersionInformation are optional
Randomize()
mstrAppID = "EDS.App" & Format(Int(Rnd() * 1000).ToString) 'for demonstration purposes, generate a random AppID
Call SetCurrentProcessExplicitAppUserModelID(mstrAppID) 'N.B. this sets the AppID for the whole instance
Me.Text = mstrAppID
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim f As New Form
f.Text = "Child window of " & mstrAppID
f.Show()
End Sub
End Class