Blub
Blub

Reputation: 13634

Setting the taskbar overlay icon with programmatically created

I'm in the process of programmatically recreating an overlay icon so to present text on the taskbar icon. I did this:

    GlyphRunDrawing gDrawing = new GlyphRunDrawing(Brushes.Black,
                                           iconOverlayText.ToGlyphRun());

    Window.TaskbarItemInfo = 
        new System.Windows.Shell.TaskbarItemInfo();
    DrawingImage image = new DrawingImage();
    image.Drawing = gDrawing;

    Window.TaskbarItemInfo.Overlay = image;

The image source seems fine, if I set "image" as the source of a test wpf image, the text displays just fine. But for some reason, it doesn't display on the taskbar icon. Do you know why?

So I tried a few other options, like the official taskbar support libraries. It's a little confusing, because there are two of them seemingly, but neither worked to show an icon overlay for me:

It doesnt work on this official sample application sample MainDemo and IMClient demo:

http://code.msdn.microsoft.com/Windows7Taskbar

And I can't start the other samples collection called Win7API Codepack sample, because of this cryptic error:

TaskDialog feature needs to load version 6 of comctl32.dll but a different version is current loaded in memory.

Any suggestion what might be wrong?

Upvotes: 2

Views: 3871

Answers (1)

Hans Passant
Hans Passant

Reputation: 941635

From the Remarks section of TaskbarItemInfo.Overlay:

The overlay is not displayed if the user sets the taskbar to show small icons

Upvotes: 7

Related Questions