sambyal_rajeev
February 27th, 2003, 11:25 PM
I am working on an ATL service. My problem is that I want to display an Icon whenever the service starts. Also on the click of icon it should display a menu from where I can stop the service.
I tried using NOTIFYICON data structure but it requires parameters such as handle to the parent window and to the icon. How do I get handles to the window as there is no UI for an ATL service
Paul Ch
March 3rd, 2003, 10:46 AM
Could you not create a hidden window and use that?
Cheers
Paul
jvar
June 17th, 2003, 02:41 AM
sambyal_rajeev
i have written exe servers with tray icons, and just started looking at writing services to perform similar tasks.
I used the notifyicon in c# but that failed when I wrote a managed service. The services were cool, and I got them to install under w2000, but no icons. I have to keep looking at how the notifyIcon wraps the notifyIcon.
There is a good example for NotifyIconEx around (on a dot net site i think, sorry I can't remember which), that handles a lot of the functionality in the wrapper.
I was thinking it was the same thing that it needed a window, and I saw one example in c++ where a CreateWindowEx was used to make one on the fly. One thing with the TrayIcon, i think the window handles the message callback from the mouse events, so you have to handle them somehow.
Without the handling in the servers, the icon couldn't repaint if the systray needed it and would just disappear.
I have just started on this but if you work it out, please put your results up here, i would be very interested.
thanks