Si usas WPF, según he leido tienes acceso a las JumpLists (y no se si también a la PinList) desde las classes de las librerías
WindowsBase y otra que no recuerdo ya.
Para WinForms:
Si tu intención es anclar el executable a la barra de tareas entonces puedes utilizar el siguiente código que he escrito, el cual he tomado la idea de
esta otra página, debo decir que no me parece nada eficiente la solucion propuesta y las modificaciones que he echo en mi código, ya que invoca un verbo (comando) y este no es de lenguaje neutro, pero al parecer tras un poco más de investigación no parece haber nada más eficiente ya que estas acciones son elecciones orientadas al usuario, no a la aplicación, no al programador, dejo una cita que me hizo gracia xD:
The pin list is for users to put their favorite icons. It is not the place for a program to decide unilaterally, "I am so cool. I am your favorite icon. I just know it. So I'll put myself there because, well, I'm so cool."
En fin, ejemplo de uso:
ItemPinner(Process.GetCurrentProcess.MainModule.FileName, PinState.PinToTaskBar)
Source:
' ItemPinner
' ( By Elektro )
'
' Instructions:
' 1. Add a reference to 'Microsoft Shell Controls And Automation'
'
' Usage Examples:
' ItemPinner("C:\Application.exe", PinState.PinToTaskBar)
''' <summary>
''' Specifies the Pin state for an Item.
''' </summary>
Public Enum PinState As Integer
''' <summary>
''' Pins an Item onto TaskBar.
''' </summary>
PinToTaskBar = 0I
''' <summary>
''' Unpins an Item from TaskBar.
''' </summary>
UnpinFromTaskBar = 1I
''' <summary>
''' Pins an Item onto Start Menu.
''' </summary>
PinToStartMenu = 2I
End Enum
''' <summary>
''' Pins or unpins an item onto TaskBar or StartMenu.
''' A pinned item in the StartMenu can't be unpinned.
''' </summary>
''' <param name="filePath">The file path.</param>
''' <param name="pinState">State of the pin.</param>
Public Shared Sub ItemPinner(ByVal filePath As String, ByVal pinState As PinState)
' Localized verb names to pin an item onto TaskBar.
Dim pinTaskbarVerbs As String() =
{
"pin to taskbar",
"anclar a la barra de tareas"
}
' Localized verb names to unpin an item from TaskBar.
Dim unpinTaskbarVerbs As String() =
{
"unpin from taskbar",
"desanclar de la barra de tareas"
}
' Localized verb names to pin an item onto StartMenu.
Dim pinStartMenuVerbs As String() =
{
"pin to start menu",
"anclar a inicio"
}
' ShellApplication Class Instance.
Dim shell As New Shell
' Gets the item to check for its pin/unpin verb and invoke it later.
Dim link As FolderItem = shell.[NameSpace](Path.GetDirectoryName(filePath)).
ParseName(Path.GetFileName(filePath))
' The item-verb to invoke.
Dim verb As FolderItemVerb = Nothing
Select Case pinState
Case pinState.PinToTaskBar
verb = (From ItemVerb As Object In link.Verbs
Where pinTaskbarVerbs.Contains(DirectCast(ItemVerb, FolderItemVerb).
Name.Replace("&"c, String.Empty).ToLower)
Select DirectCast(ItemVerb, FolderItemVerb)
).FirstOrDefault
Case pinState.UnpinFromTaskBar
verb = (From ItemVerb As Object In link.Verbs
Where unpinTaskbarVerbs.Contains(DirectCast(ItemVerb, FolderItemVerb).
Name.Replace("&"c, String.Empty).ToLower)
Select DirectCast(ItemVerb, FolderItemVerb)
).FirstOrDefault
Case pinState.PinToStartMenu
verb = (From ItemVerb As Object In link.Verbs
Where pinStartMenuVerbs.Contains(DirectCast(ItemVerb, FolderItemVerb).
Name.Replace("&"c, String.Empty).ToLower)
Select DirectCast(ItemVerb, FolderItemVerb)
).FirstOrDefault
Case Else ' Do Nothing.
Exit Select
End Select
If verb IsNot Nothing Then
verb.DoIt() ' Invoke the verb.
End If
End Sub
Saludos.