tags:

views:

153

answers:

2

What DLLs would have functions for accessing things in the System Tray? Do I even need the winapi, or are there classes already available in the Class Library for this? I'm hoping to find a way to emulate all the functionality of the system tray, i.e. the icons, the mouseover text, and the capability to display the context menu.

+2  A: 

You can enumerate tray icons, retrieve tooltips, emulate single click, double and right click. See this article which explains how to do it with winapi: Shell Tray Info - Arrange your system tray icons

Giorgi
Do you know if these WinAPI calls also work in Windows 7 or Vista? Upon running the app on the site, a messagebox is displayed telling me it'll only run on XP.
Corey Ogburn
@Corey Ogburn - you are getting the message because the author of the app has tested it only on XP. If you want to you can download the source code and remove the check to see how it performs on Vista/7 Taskbar has changed quite a lot so it is quite possible that the app will not work. You can use spy++ to see if you can make necessary changes.
Giorgi
+2  A: 

There is the Shell_NotifyIcon function to work with tray icons natively. With .NET there is NotifyIcon class you can use, which does the job.

liggett78
The question is about enumerating existing icons, not just adding them for current process.
Giorgi
Somehow I don't see a word "enumerate" in the original question.
liggett78