Quantcast
Channel: The Old New Thing
Viewing all articles
Browse latest Browse all 24428

re: How do I customize how my application windows are grouped in the Taskbar?

$
0
0

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


Viewing all articles
Browse latest Browse all 24428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>