Hello Tim
Keep them separate. If you combine the two into one exe, you will not be
able to start the service again. You could get your users to use the Services
applet to start the service and then use the system tray portion to stop it.
Rather separate them as that is what SQL Server has done with the service
exe and then the Service Manager exe which sits in the system tray.
Hope this helps...
Regards,
Simon
> I built a Windows Service exe, and a separate exe to control it which has a
> nice little icon on the system tray. I'm wondering if there is a "right" way
[quoted text clipped - 7 lines]
> the controller app always around (didn't want to have to Schedule it etc,
> just wanted it to start up along with the service).
Tim Johnson - 01 Mar 2006 09:17 GMT
Makes sense. I was just trying to figure how to make that icon always be in
the system tray, ie have my svc controller app always running. I can always
make it a Startup app but I guess I was thinking there might be a prescribed
way to couple the 2 apps - what makes all those other tray icons show up
automatically, aren't most of them related to services or are they just
drivers (wifi, sql server, etc)?
> Hello Tim
>
[quoted text clipped - 19 lines]
> > the controller app always around (didn't want to have to Schedule it etc,
> > just wanted it to start up along with the service).
Simon Murrell - 01 Mar 2006 11:31 GMT
Hello Tim
Well the SQL Service Manager is normally added to the Startup menu
in Windows. That is probably the easiest and cleanest way to do it.
Regards,
Simon
> Makes sense. I was just trying to figure how to make that icon always be in
> the system tray, ie have my svc controller app always running. I can always
[quoted text clipped - 26 lines]
> > > the controller app always around (didn't want to have to Schedule it etc,
> > > just wanted it to start up along with the service).
Adam Klobukowski - 01 Mar 2006 11:41 GMT
Simon Murrell napisał(a):
> Hello Tim
>
> Well the SQL Service Manager is normally added to the Startup menu
> in Windows. That is probably the easiest and cleanest way to do it.
I've written a service and service controller that way (2 separate
apps). I have a problem with controler application: it has a windo that
is always opened, only just hidden or shown to the user. It hase close
widget, but it just hides window (no close). The problem is that when
I'm switching machine off, i prevents it. There is no erro message, or
anything, machine just does not switch off. When I exit it manually -
computer can be switched off.
I tried hooking at Application.ApplicationExit do detect application
going down, but it didn't help. How can I distinguish if Form.Closing
event is fired becouse user clicked close widget or becouse system is
going down?

Signature
Semper Fidelis
Adam Klobukowski
atari@gabo.pl