10

In WMP, I have been shown buttons on the taskbar thumbnail. How can I make them for my winforms app in C#?

enter image description here

Sri Harsha Chilakapati
  • 11,744
  • 6
  • 50
  • 91

2 Answers2

5

XAML

<Window.TaskbarItemInfo>
    <TaskbarItemInfo>
        <TaskbarItemInfo.ThumbButtonInfos>
            <ThumbButtonInfo ImageSource="/IconProgressDemo;component/Icon1.ico" Description="Play!" Click="ThumbButtonInfo_Click" />
            <ThumbButtonInfo ImageSource="/IconProgressDemo;component/Icon2.ico" Description="Stop!" Click="ThumbButtonInfo_Click" />
        </TaskbarItemInfo.ThumbButtonInfos>
    </TaskbarItemInfo>
</Window.TaskbarItemInfo>

C#

private void ThumbButtonInfo_Click(object sender, EventArgs e)
{
    MessageBox.Show((sender as System.Windows.Shell.ThumbButtonInfo).Description);
}

I haven't tried this hope this will be helpful.

and refer these links.

http://www.zayko.net/post/Adding-Buttons-to-Window-Thumbnail-in-WPF-4-for-Windows-7-(C).aspx

http://msdn.microsoft.com/en-us/windows7trainingcourse_win7taskbarmanaged_topic2.aspx

http://msdn.microsoft.com/en-us/magazine/dd942846.aspx

and there is Taskbar API available you can try with that.

Sri Harsha Chilakapati
  • 11,744
  • 6
  • 50
  • 91
backtrack
  • 7,996
  • 5
  • 52
  • 99
  • Thanks for answering. But I have been using winforms. – Sri Harsha Chilakapati Aug 20 '13 at 05:09
  • I know that I am late, but is there a ref for UWP applications? I cannot use the `System.Windows.Shell` Would like to add media buttons like this: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/189ef162-9ca3-41aa-8859-5b8e08c70eaa/taskbar-thumbnail-media-toolbar – JP Hellemons Dec 04 '18 at 07:59
5

The WindowsAPICodePack contains a control called ThumbnailToolBarButton that you can use to get this functionality going.

You'll need to make sure you have icons for each of the buttons (as I don't believe you can put text on them), and then it should be a simple matter of creating new controls and adding relevant event handlers.

Sourced from here.

Adrian
  • 2,825
  • 1
  • 22
  • 32
  • 1
    WindowsAPICodePack no longer exists, the link is broken. Try VistaUIFramework, it contains all Windows 7 taskbar features except tabbed thumbnails. https://github.com/myapkapp/VistaUIFramework –  May 03 '17 at 01:08