setcurrentprocessexplicitappusermodelid (shell32)
Last changed: bthetford-164.55.254.106

.
Summary
SetCurrentProcessExplicitAppUserModelID sets the System.AppUserModel.ID property of the calling object. It is used by Windows 7 and up for taskbar icon stacking, jump lists, and taskbar pinning.

C# Signature:

[DllImport("shell32.dll", SetLastError=true)]
static extern void SetCurrentProcessExplicitAppUserModelID( [MarshalAs( UnmanagedType.LPWStr )] string AppID );

VB Signature:

Declare Function SetCurrentProcessExplicitAppUserModelID Lib "shell32.dll" (<MarshalAs(UnmanagedType.LPWStr)> ByVal appid As String) As Integer

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

AppID must match for all processes and windows of the same application that you wish to be grouped in the same stack on the Windows taskbar.

Be sure to also set the System.AppUserModel.ID property of any shortcuts created for your application to the same value, as well, or they may not be pinnable to the taskbar.