By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,543 Members | 2,169 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,543 IT Pros & Developers. It's quick & easy.

Windows Service.. System Tray

P: n/a
Hello all,

I have created a windows service and now I would like to have a
configuration page in the system tray. Basically an icon I can click on
which will just interact with an XML file. What is the best way to do this?

1. How do I use the System Tray and add an icon on it. Yes, probably
basic.. and I can do it with VB but have never tried with C#.

Andrew Mueller
Nov 15 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Actually, the NotifyIcon class provides this
functionality in .NET

This is one important point here: You should
not interact with the UI when you're a windows
service.

This is:
a.) Because of security (what if the user on
the UI has less privileges then you? You give
them access to a higher-privileged process)

b.) Which UI do you connect to? What if it's a
terminal services server with 10 users
connected in and no one is physically
at the main console (Console0).

You should develop a standalone WinForms app
with a notifyicon and all that goodness that
uses remoting to communicate with the service.

Make sure the service has a way to configure
what Windows users can even connect, and then
once in, what they can configure. That gets
pretty complicated, so I'll leave it up to
you to decide what you're going to do
exactly (not integrate with AD, just have
your own user/pass, or try to use AD
integration, whatever).

-c

"Rob Tillie" <Ro********@student.tul.edu> wrote in message
news:un*************@tk2msftngp13.phx.gbl...
I believe it's not part of the .NET framework yet... must be on google
somewhere... some wrapper usong P/Invoke for this...

Greetz,
-- Rob.

Andrew Mueller wrote:
Hello all,

I have created a windows service and now I would like to have a
configuration page in the system tray. Basically an icon I can click on which will just interact with an XML file. What is the best way
to do this?

1. How do I use the System Tray and add an icon on it. Yes,
probably basic.. and I can do it with VB but have never tried with C#.
Andrew Mueller


Nov 15 '05 #2

P: n/a
Andrew, there is a very good example posted on the gotdotnet.com site
under the user samples section. If you haven't been there then you are
missing out bigtime!

"Andrew Mueller" <am******@instechnet.com> wrote in message news:<uP*************@tk2msftngp13.phx.gbl>...
Hello all,

I have created a windows service and now I would like to have a
configuration page in the system tray. Basically an icon I can click on
which will just interact with an XML file. What is the best way to do this?

1. How do I use the System Tray and add an icon on it. Yes, probably
basic.. and I can do it with VB but have never tried with C#.

Andrew Mueller

Nov 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.