1

I'm working on a project and we'd like to add a notification count the way skype does.

A number pops near the icon in the windows taskbar to indicate how many messages the user have received. This is the result we're trying to achieve: http://it.tinypic.com/r/2guclkk/8

Looking around the internet haven't led to anything, so is there any API I can use in C# to achieve this?

Phate01
  • 2,499
  • 2
  • 30
  • 55
  • I solved using the WindowsAPICodePack: http://stackoverflow.com/questions/24081665/windows-api-code-pack-where-is-it – Phate01 Oct 22 '15 at 07:42

2 Answers2

3

I solved using the WindowsAPICodePack: Windows API Code Pack: Where is it?

The method is SetIconOverlay():

public void SetOverlayIcon(IntPtr windowHandle, Icon icon, string accessibilityText);
Community
  • 1
  • 1
Phate01
  • 2,499
  • 2
  • 30
  • 55
  • I am using forms in my app and i had downloaded WindowsAPICodePack through Visual studio PM console. Should i need to add any more references before i use SetOverlayIcon API, as it is not detecting it as a known method. – rajkumaradass Jun 02 '17 at 12:17
0

If you want that in taskbar, you might want to use overlay icons, which are described here, if you are using WPF: How to add dynamic text as Taskbar Icon overlay? If you are using Forms you might want to use this: https://msdn.microsoft.com/en-us/library/system.windows.shell.taskbariteminfo.overlay%28v=vs.100%29.aspx

If you want to do the same in system tray, it is a duplicit question: How can I overlay system-tray icon ? WPF, and the answer is probably to draw the desired number at runtime to the icon and change the system tray icon.

Community
  • 1
  • 1
Matyas
  • 1,122
  • 5
  • 23
  • 29