system tray icons from windows service

Hi Experts,
I'd like to show an s system tray icon when my service is running - but I don't want to use ATL or MFC - just STL if anything and straight Windows libraries.  Is there some wrapper around that can help me accomplish this?

Who is Participating?
jkrConnect With a Mentor Commented:
First of all: You cannot display a tray icon from a service unless you set the service to 'Interact with the Desktop' - which is not what you want to do, because thisw creates a potential security loophole. Yet if you'd want to go that way, see ("A service that displays an icon in the system tray"). A better idea would be to create a small app that displays that icon (and does nothingt else) and have it communicate with your service to get update info via some IPC mechanism, see ("Windows IPC") for your options. That leaves us to the 'Icon' part, which is covered by ("Adding Icons to the System Tray") which also demonstrates how to do that without using MFC.
threadyAuthor Commented:
That's just what I was thinking and you confirmed it for me.  Just a side question on this other little app - can I launch it from my service on startup?
You can, but that's a bit more complicated. I'd rather place it in the 'Autorun' section, for the simple reason that a) noone might be logged on when your service starts and b) there might be more than 1 user logged on at a time.
threadyAuthor Commented:
I knew that side question would be worth asking. :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.